Пример #1
0
        public void GetCustomizationFromNullParameterThrows()
        {
            // Arrange
            var sut = new FavorArraysAttribute();

            // Act & assert
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.GetCustomization(null));
        }
 public void GetCustomizationFromNullParameterThrows()
 {
     // Fixture setup
     var sut = new FavorArraysAttribute();
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() =>
         sut.GetCustomization(null));
     // Teardown
 }
Пример #3
0
        public void GetCustomizationFromNullParameterThrows()
        {
            // Fixture setup
            var sut = new FavorArraysAttribute();

            // Exercise system and verify outcome
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.GetCustomization(null));
            // Teardown
        }
Пример #4
0
        public void GetCustomizationReturnsCorrectResult()
        {
            // Arrange
            var sut       = new FavorArraysAttribute();
            var parameter = typeof(TypeWithOverloadedMembers).GetMethod("DoSomething", new[] { typeof(object) }).GetParameters().Single();
            // Act
            var result = sut.GetCustomization(parameter);
            // Assert
            var invoker = Assert.IsAssignableFrom <ConstructorCustomization>(result);

            Assert.Equal(parameter.ParameterType, invoker.TargetType);
            Assert.IsAssignableFrom <ArrayFavoringConstructorQuery>(invoker.Query);
        }
 public void GetCustomizationReturnsCorrectResult()
 {
     // Fixture setup
     var sut = new FavorArraysAttribute();
     var parameter = typeof(TypeWithOverloadedMembers).GetMethod("DoSomething", new[] { typeof(object) }).GetParameters().Single();
     // Exercise system
     var result = sut.GetCustomization(parameter);
     // Verify outcome
     var invoker = Assert.IsAssignableFrom<ConstructorCustomization>(result);
     Assert.Equal(parameter.ParameterType, invoker.TargetType);
     Assert.IsAssignableFrom<ArrayFavoringConstructorQuery>(invoker.Query);
     // Teardown
 }
        public void GetCustomizationReturnsCorrectResult()
        {
            // Fixture setup
            var sut       = new FavorArraysAttribute();
            var parameter = typeof(TypeWithOverloadedMembers).GetMethod("DoSomething", new[] { typeof(object) }).GetParameters().Single();
            // Exercise system
            var result = sut.GetCustomization(parameter);

            // Verify outcome
            Assert.IsAssignableFrom <ConstructorCustomization>(result);
            var invoker = (ConstructorCustomization)result;

            Assert.AreEqual(parameter.ParameterType, invoker.TargetType);
            Assert.IsAssignableFrom <ArrayFavoringConstructorQuery>(invoker.Query);
            // Teardown
        }