public void InternalClassTest()
        {
            var o  = new InternalTestClass();
            var pi = CreatePI <int, InternalTestClass>("Int");

            pi.Set(o, 50);
            Assert.AreEqual(50, o.Int);
            Assert.AreEqual(50, pi.Get(o));
        }
Exemplo n.º 2
0
        public void IsImmutable_object_InternalTestClass()
        {
            //Arrange
            var    validator = new ImmutableValidator();
            object target    = new InternalTestClass();

            //Act
            var actual = validator.IsImmutable(target);

            //Assert
            Assert.True(actual);
        }
Exemplo n.º 3
0
        private void InternalTest()
        {
            var test1 = new InternalTestClass();

            /*
             * can not access,
             * can access only public
             */
            //test1.TestInternalFunc();
            test1.PublicTestFunc();

            var test3 = new ProtectedInternalTestClass();

            test3.testFunction();
        }
Exemplo n.º 4
0
        public void SimplScalarTagReprIsFieldName()
        {
            var testObj = new InternalTestClass();

            testObj.ourScalar = 3;

            SimplTypesScope sTs = SimplTypesScope.Get("scalarTestScope", typeof(InternalTestClass));

            TestMethods.TestSimplObject(testObj, sTs);

            var resultStream = TestMethods.TestSerialization(testObj, Format.Xml);

            string xmlString = resultStream.StringData;

            XElement xe = XElement.Parse(xmlString);

            Assert.IsTrue(xe.Attributes("our_scalar").Any(), "Should have an XML scalar attribute \"our_scalar\"");
            Assert.IsTrue(int.Parse(xe.Attribute("our_scalar").Value.ToString()) == 3, "Our scalar value should be equal to 3!");
        }
Exemplo n.º 5
0
    public static void RunStartupTest()
    {
        try
        {
            InternalTestClass c = new InternalTestClass();

            c.A = 123;
            c.B = "Hello";

            string s = c._ObjectToJson();

            if (s._InStri("Hello") == false)
            {
                throw new CoresException("s._InStri(\"Hello\") == false");
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("Json.RunTest Fatal Error: " + ex.ToString());
            ThreadObj.Sleep(1000);
            Environment.Exit(-1);
        }
    }
Exemplo n.º 6
0
 public InternalCompositeTestClass(int A)
 {
     this.internalComposite = new InternalTestClass(A);
 }
Exemplo n.º 7
0
 public InternalCompositeTestClass(int A)
 {
     this.internalComposite = new InternalTestClass(A);
 }
Exemplo n.º 8
0
        public void SimplScalarTagReprIsFieldName()
        {
            var testObj = new InternalTestClass();

            testObj.ourScalar = 3;

            SimplTypesScope sTs = SimplTypesScope.Get("scalarTestScope", typeof(InternalTestClass));

            TestMethods.TestSimplObject(testObj, sTs);

            var resultStream = TestMethods.TestSerialization(testObj, Format.Xml);

            string xmlString = resultStream.StringData;

            XElement xe = XElement.Parse(xmlString);

            Assert.IsTrue(xe.Attributes("our_scalar").Any(), "Should have an XML scalar attribute \"our_scalar\"");
            Assert.IsTrue(int.Parse(xe.Attribute("our_scalar").Value.ToString()) == 3, "Our scalar value should be equal to 3!");
        }
Exemplo n.º 9
0
 public static void ExtensionMethod(this InternalTestClass subject)
 {
 }