示例#1
0
        public void BasicMethodDiffersInCase()
        {
            var input  = new MethodTests();
            var result = Invoke(input, "stringRESULT");

            Assert.AreEqual("hello world", result);
        }
示例#2
0
        public void FieldInvokedForMethodWithNoArguments()
        {
            var target = new MethodTests();
            var result = Invoke(target, "Field");

            Assert.AreEqual("Marshal", result);
        }
示例#3
0
        public void MethodNameExactMatch()
        {
            var input  = new MethodTests();
            var result = Invoke(input, "StringResult");

            Assert.AreEqual("hello world", result);
        }
示例#4
0
        public void ParamArrayWithTwoNullArguments()
        {
            var target = new MethodTests();
            var result = Invoke(target, "ParamArray", null, null);

            Assert.AreEqual(2, result);
        }
示例#5
0
        public void PropertyInvokedForMethodWithNoArguments()
        {
            var target = new MethodTests();
            var result = Invoke(target, "Property");

            Assert.AreEqual("A property", result);
        }
示例#6
0
        public void ParamArrayWithArrayWithOneNullArgument()
        {
            var target = new MethodTests();
            var result = Invoke(target, "ParamArray", new object[] { new object[1] });

            Assert.AreEqual(1, result);
        }
示例#7
0
        public void ParamArrayWithNullArgument()
        {
            var target = new MethodTests();
            var result = Invoke(target, "ParamArray", new object[] { null });

            Assert.IsNull(result);
        }
示例#8
0
        public void ParamArrayWithTwoArguments()
        {
            var target = new MethodTests();
            var result = Invoke(target, "ParamArray", "one", "two");

            Assert.AreEqual(2, result);
        }
示例#9
0
        public void ParamArrayWithNoArguments()
        {
            var target = new MethodTests();
            var result = Invoke(target, "ParamArray");

            Assert.AreEqual(0, result);
        }
示例#10
0
        public void MethodOneParamaterAssignableTypeMatch()
        {
            var target = new MethodTests();
            var param1 = "hello world";
            var result = Invoke(target, "OneParameter", param1);

            Assert.AreEqual("One Param Success", result);
        }
示例#11
0
        public void MethodOneParamaterExactTypeMatch()
        {
            var target = new MethodTests();
            var param1 = new object();
            var result = Invoke(target, "OneParameter", param1);

            Assert.AreEqual("One Param Success", result);
        }
示例#12
0
        public void ParamArrayWithArrayArguments()
        {
            var target = new MethodTests();
            var arg1   = new string[] { "one", "two" };
            var result = Invoke(target, "ParamArray", new[] { arg1 });

            Assert.AreEqual(2, result);
        }
 public void calling_static()
 {
     StaticMethod("hej");
     //this.StaticMethod("hej"); // Error, this är instancen av en klass. Static ligger på "typen".
     MethodTests.StaticMethod("hello");
 }