AcceptingStateConditionAttribute Class

Indicates that a parameter-free method or Boolean property is an accepting state condition.

Namespace: Microsoft.Modeling
Assembly: Microsoft.Xrt.Runtime (in Microsoft.Xrt.Runtime.dll)

Usage

'Usage

Syntax

'Declaration
[AttributeUsageAttribute(AttributeTargets.Method|AttributeTargets.Property, AllowMultiple=false, Inherited=false)] 
public sealed class AcceptingStateConditionAttribute : Attribute

Example

The following example shows the use of the AcceptingStateCondition attribute. States of this model program are accepting only if the mailboxes of all clients that have ever been created are empty.

namespace Microsoft.MyModel
{
   class Client
   {
      Sequence<object> mailbox;

      [AcceptingStateCondition]
      static bool AllMailDelivered()
      {
         return mailbox.Count == 0;
      }
   }
}

Remarks

An accepting state is a state where a test can successfully end, leaving the system under test in a stable state.

If the target of an AcceptingStateCondition attribute is a method, it can be static or instance-based. In the latter case, the state is accepting if the condition holds for all reachable instances of the class.

For more information about using attributes, see Extending Metadata Using Attributes.

Inheritance Hierarchy

System.Object
   System.Attribute
    Microsoft.Modeling.AcceptingStateConditionAttribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Microsoft Windows 7, Microsoft Windows Vista, Microsoft Windows XP SP2 or later, Microsoft Windows Server 2008, Microsoft Windows Server 2003

Change History

See Also

Reference

AcceptingStateConditionAttribute Members
Microsoft.Modeling Namespace

Other Resources

State Attributes