예제 #1
0
        public void InvokeWithFactoryMethodReturnsCorrectResult(Type targetType, int index, object values)
        {
            // Arrange
            var method = (from mi in targetType
                          .GetMethods(BindingFlags.Static | BindingFlags.Public)
                          where mi.ReturnType == targetType
                          select mi).ElementAt(index);
            var sut = new StaticMethod(method);

            // Act
            var result = sut.Invoke((object[])values);

            // Assert
            Assert.IsAssignableFrom(targetType, result);
        }
예제 #2
0
        public void InvokeWithFactoryMethodReturnsCorrectResult(Type targetType, int index, object values)
        {
            // Fixture setup
            var method = (from mi in targetType
                          .GetMethods(BindingFlags.Static | BindingFlags.Public)
                          where mi.ReturnType == targetType
                          select mi).ElementAt(index);
            var sut = new StaticMethod(method);

            // Exercise system
            var result = sut.Invoke((object[])values);

            // Verify outcome
            Assert.IsAssignableFrom(targetType, result);
            // Teardown
        }
예제 #3
0
        public void InvokeWithFactoryMethodReturnsCorrectResult(Type targetType, int index, object values)
        {
            // Fixture setup
            var method = (from mi in targetType
                              .GetMethods(BindingFlags.Static | BindingFlags.Public)
                          where mi.ReturnType == targetType
                          select mi).ElementAt(index);
            var sut = new StaticMethod(method);

            // Exercise system
            var result = sut.Invoke((object[])values);
            // Verify outcome
            Assert.IsAssignableFrom(targetType, result);
            // Teardown
        }