public void NullTests()
        {
            TestClass a             = null;
            var       myDeclaration = VariableLiteral.GetNewLiteral(a);

            Assert.AreEqual("null",
                            myDeclaration);
        }
        public void ArrayTests()
        {
            int[] myArray = { 1, 2, 3, 4, 5 };

            var myDeclaration = VariableLiteral.GetNewLiteral(myArray);

            Assert.AreEqual("new System.Int32[] {1,2,3,4,5}",
                            myDeclaration);
        }
        public void PrimitiveAndClassTests()
        {
            var a = new TestClass(4, "Hello\r\nHello\tmy\'Tab\"\v", true, '\n', 123443435465, 123.453F);

            var myDeclaration = VariableLiteral.GetNewLiteral(a);

            Assert.AreEqual("new TestClass {FieldA = 4,FieldB = \"Hello\\r\\nHello\\tmy\\\'Tab\\\"\\v\",FieldC = true,FieldD = '\\n',FieldE = 123443435465,FieldF = 123.453F}",
                            myDeclaration);
        }
        public void NullPropertyTests()
        {
            var a = new TestClass(5, null, true, '\n', 123443435465, 123.453F);

            var myDeclaration = VariableLiteral.GetNewLiteral(a);

            Assert.AreEqual("new TestClass {FieldA = 5,FieldB = null,FieldC = true,FieldD = '\\n',FieldE = 123443435465,FieldF = 123.453F}",
                            myDeclaration);
        }
        public void EnumFlagsTests()
        {
            myColors testColors = myColors.Blue | myColors.Green;

            var myDeclaration = VariableLiteral.GetNewLiteral(testColors);

            Assert.AreEqual("myColors.Green | myColors.Blue",
                            myDeclaration);
        }
예제 #6
0
        public void myTestMethod0()
        {
//No special treatment

            var a = 23;
            var b = 3;
            var d = "Hi \n \" \\ \v \t \r";

            Assert.AreEqual("Hi \n \" \\ \v \t \r26", VariableLiteral.GetNewLiteral(testFunction(a, b, d)).GetLiteral());
        }
예제 #7
0
        public void myTestMethod3()
        {
//No special treatment

            var a = -34;
            var b = 23;
            var d = "AAAAA";

            Assert.AreEqual("AAAAA-11", VariableLiteral.GetNewLiteral(testFunction(a, b, d)).GetLiteral());
        }
예제 #8
0
        public void myTestMethod2()
        {
//No special treatment

            var a = 2;
            var b = 4;
            var d = "שלום\"שלום";

            Assert.AreEqual("שלום\"שלום6", VariableLiteral.GetNewLiteral(testFunction(a, b, d)).GetLiteral());
        }
예제 #9
0
        public void myTestMethod1()
        {
//No special treatment

            var a = 1;
            var b = 2;
            var d = "Hello\nHello\n";

            Assert.AreEqual("Hello\nHello\n3", VariableLiteral.GetNewLiteral(testFunction(a, b, d)).GetLiteral());
        }
        public void EnumTests()
        {
            Days myDay = Days.Sun;


            var myDeclaration = VariableLiteral.GetNewLiteral(myDay);

            Assert.AreEqual("Days.Sun",
                            myDeclaration);
        }
        public void ListTests()
        {
            var a = new TestClass(4, "Hello\nHello", true, '\n', 123443435465, 123.453F);
            var b = new TestClass(4, "Hello\nHello\nHello", false, '\n', 12653443435465, 123.47653F);

            List <TestClass> myList = new List <TestClass>
            {
                a,
                b
            };

            var myDeclaration = VariableLiteral.GetNewLiteral(myList);

            Assert.AreEqual("new List<RuntimeSpiesTest.TestClass>{new TestClass {FieldA = 4,FieldB = \"Hello\\nHello\",FieldC = true,FieldD = \'\\n\',FieldE = 123443435465,FieldF = 123.453F},new TestClass {FieldA = 4,FieldB = \"Hello\\nHello\\nHello\",FieldC = false,FieldD = \'\\n\',FieldE = 12653443435465,FieldF = 123.4765F}}",
                            myDeclaration);
        }