Fluent Assertions Documentation
FluentAssertions.Execution Namespace / AssertionScope Class
Members
In This Topic
    AssertionScope Class
    In This Topic
    Represents an implicit or explicit scope within which multiple assertions can be collected.
    Object Model
    AssertionScope ClassAssertionScope ClassFormattingOptions Class
    Syntax
    public sealed class AssertionScope 
    Remarks
    This class is supposed to have a very short lifetime and is not safe to be used in assertion that cross thread-boundaries such as when using async or await.
    Inheritance Hierarchy

    System.Object
       FluentAssertions.Execution.AssertionScope

    Public Constructors
     NameDescription
    Public ConstructorOverloaded.   
    Top
    Public Properties
     NameDescription
    Public Propertystatic (Shared in Visual Basic) Gets the current thread-specific assertion scope.  
    Public Property Exposes the options the scope will use for formatting objects in case an assertion fails.  
    Public Property Gets or sets the name of the current assertion scope, e.g. the path of the object graph that is being asserted on.  
    Top
    Public Methods
     NameDescription
    Public Method Adds a pre-formatted failure message to the current scope.  
    Public Method Adds a block of tracing to the scope for reporting when an assertion fails.  
    Public MethodReturns all failures that happened up to this point and ensures they will not cause Dispose to fail the assertion.  
    Public Method  
    Public Method  
    Top
    Extension Methods
     NameDescription
    Public Extension MethodSafely casts the specified object to the type specified through TTo.
    Public Extension MethodOverloaded. Invokes the specified action on a subject so that you can chain it with any of the assertions from FluentAssertions.Specialized.NonGenericAsyncFunctionAssertions
    Public Extension MethodOverloaded. Forces enumerating a collection. Should be used to assert that a method that uses the yield keyword throws a particular exception.
    Public Extension Method Provides methods for asserting the execution time of a method or property.
    Public Extension MethodOverloaded. Invokes the specified action on a subject so that you can chain it with any of the assertions from FluentAssertions.Specialized.ActionAssertions
    Public Extension MethodOverloaded. Starts monitoring eventSource for its events.
    Public Extension MethodOverloaded. Returns an FluentAssertions.Specialized.ExecutionTimeAssertions object that can be used to assert the current FluentAssertions.Specialized.ExecutionTime.
    Public Extension MethodOverloaded. Returns an FluentAssertions.Primitives.EnumAssertions<TEnum,TAssertions> object that can be used to assert the current TEnum.
    Top
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also