| SmartTestAssignT Method |
Creates an
AssignActT, i.e. represents an Assignment of a
property
for the Act part of the test.
Namespace:
SmartTests
Assembly:
SmartTests (in SmartTests.dll) Version: 1.12.0
Syntax public static Act<T> Assign<T>(
Expression<Func<T>> property,
T value
)
Public Shared Function Assign(Of T) (
property As Expression(Of Func(Of T)),
value As T
) As Act(Of T)
public:
generic<typename T>
static Act<T>^ Assign(
Expression<Func<T>^>^ property,
T value
)
static member Assign :
property : Expression<Func<'T>> *
value : 'T -> Act<'T>
Parameters
- property
- Type: System.Linq.ExpressionsExpressionFuncT
A lambda expression of the property to set in the Act part. - value
- Type: T
The value to assign to the property.
Type Parameters
- T
- The type of the property to set.
Return Value
Type:
ActTThe newly created
AssignActT.
Examples [Test]
public void MyPropertyTest()
{
var mc = new MyClass( 10 );
var result = RunTest( AnyValue.IsValid,
() => mc.Value );
Assert.AreEqual( 10, result );
}
See Also