예제 #1
0
        public void NoArgsDefaultParameterValue()
        {
            // Arguments of the same type should have their relative ordering preserved when the
            // method has multiple arguments of that type
            var result = Invoke.StaticMethod(typeof(TestObject), "TestC");

            result.Value.Should().Be("C,0");
        }
예제 #2
0
        public void OrderedArguments()
        {
            // Arguments of the same type should have their relative ordering preserved when the
            // method has multiple arguments of that type
            var result = Invoke.StaticMethod(typeof(TestObject), "TestB", 1, 2);

            result.Value.Should().Be("B,1,2");
        }
예제 #3
0
        public void NoMatch()
        {
            // TestA has a parameterless overload, so that will be invoked
            var result = Invoke.StaticMethod(typeof(TestObject), "TestA", "ok");

            result.Value.Should().Be("A");

            // TestB has no parameterless overload, so there is no match
            result = Invoke.StaticMethod(typeof(TestObject), "TestB", "ok");
            result.Success.Should().BeFalse();
        }
예제 #4
0
        public void BoxingDouble()
        {
            var result = Invoke.StaticMethod(typeof(TestObject), "TestA", 3.14, "ok");

            result.Value.Should().Be("A,3.14,ok");
        }
예제 #5
0
        public void DefaultParameter()
        {
            var result = Invoke.StaticMethod(typeof(TestObject), "TestA", 5);

            result.Value.Should().Be("A,5,");
        }
예제 #6
0
        public void ExactArguments()
        {
            var result = Invoke.StaticMethod(typeof(TestObject), "TestA", 5, "ok");

            result.Value.Should().Be("A,5,ok");
        }
예제 #7
0
        public void NoArguments_CaseInsensitive()
        {
            var result = Invoke.StaticMethod(typeof(TestObject), "testa");

            result.Value.Should().Be("A");
        }
예제 #8
0
        public void NoArguments()
        {
            var result = Invoke.StaticMethod(typeof(TestObject), "TestA");

            result.Value.Should().Be("A");
        }