コード例 #1
0
        public void IdShouldWriteExpectedValue()
        {
            // arrange
            var expected = "42";
            var command = new AsyncNamedCommand<object>( "Test", p => Task.FromResult( 0 ) );

            // act
            Assert.PropertyChanged( command, "Id", () => command.Id = expected );
            var actual = command.Id;

            // assert
            Assert.Equal( expected, actual );
        }
コード例 #2
0
        public void DescriptionShouldNotAllowNull()
        {
            // arrange
            string value = null;
            var command = new AsyncNamedCommand<object>( "Test", p => Task.FromResult( 0 ) );

            // act
            var ex = Assert.Throws<ArgumentNullException>( () => command.Description = value );

            // assert
            Assert.Equal( "value", ex.ParamName );
        }