public void IdShouldWriteExpectedValue() { // arrange var expected = "42"; var command = new AsyncNamedDataItemCommand<object, object>( "Test", ( i, p ) => Task.FromResult( 0 ), null ); // act Assert.PropertyChanged( command, "Id", () => command.Id = expected ); var actual = command.Id; // assert Assert.Equal( expected, actual ); }
public void DescriptionShouldNotAllowNull() { // arrange string value = null; var command = new AsyncNamedDataItemCommand<object, object>( "Test", ( i, p ) => Task.FromResult( 0 ), null ); // act var ex = Assert.Throws<ArgumentNullException>( () => command.Description = value ); // assert Assert.Equal( "value", ex.ParamName ); }