Beispiel #1
0
        public void GetCustomizationFromNullParamterThrows()
        {
            // Arrange
            var sut = new GreedyAttribute();

            // Act & Assert
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.GetCustomization(null));
        }
Beispiel #2
0
        public void SutIsAttribute()
        {
            // Arrange
            // Act
            var sut = new GreedyAttribute();

            // Assert
            Assert.IsAssignableFrom <CustomizeAttribute>(sut);
        }
Beispiel #3
0
        public void SutIsAttribute()
        {
            // Arrange
            // Act
            var sut = new GreedyAttribute();

            // Assert
            Assert.IsInstanceOf <CustomizeAttribute>(sut);
        }
 public void GetCustomizationFromNullParamterThrows()
 {
     // Fixture setup
     var sut = new GreedyAttribute();
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() =>
         sut.GetCustomization(null));
     // Teardown
 }
 public void SutIsAttribute()
 {
     // Fixture setup
     // Exercise system
     var sut = new GreedyAttribute();
     // Verify outcome
     Assert.IsInstanceOf<CustomizeAttribute>(sut);
     // Teardown
 }
Beispiel #6
0
        public void GetCustomizationFromNullParamterThrows()
        {
            // Fixture setup
            var sut = new GreedyAttribute();

            // Exercise system and verify outcome
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.GetCustomization(null));
            // Teardown
        }
Beispiel #7
0
        public void SutIsAttribute()
        {
            // Fixture setup
            // Exercise system
            var sut = new GreedyAttribute();

            // Verify outcome
            Assert.IsInstanceOf <CustomizeAttribute>(sut);
            // Teardown
        }
Beispiel #8
0
        public void GetCustomizationReturnsCorrectResult()
        {
            // Arrange
            var sut       = new GreedyAttribute();
            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 <GreedyConstructorQuery>(invoker.Query);
        }
 public void GetCustomizationReturnsCorrectResult()
 {
     // Fixture setup
     var sut = new GreedyAttribute();
     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<GreedyConstructorQuery>(invoker.Query);
     // Teardown
 }
Beispiel #10
0
        public void GetCustomizationReturnsCorrectResult()
        {
            // Fixture setup
            var sut       = new GreedyAttribute();
            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 <GreedyConstructorQuery>(invoker.Query);
            // Teardown
        }