Exemplo n.º 1
0
        public void BasicMethodDiffersInCase()
        {
            var input  = new MethodTests();
            var result = Invoke(input, "stringRESULT");

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

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

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

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

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

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

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

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

            Assert.AreEqual(0, result);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 13
0
 public void calling_static()
 {
     StaticMethod("hej");
     //this.StaticMethod("hej"); // Error, this är instancen av en klass. Static ligger på "typen".
     MethodTests.StaticMethod("hello");
 }