Пример #1
0
        [TestInitialize] public override void TestInitialize()
        {
            base.TestInitialize();
            var r = new testRepository();

            obj = new testClass(r);
        }
Пример #2
0
        [TestMethod] public void CanSetPowerInConstructorTest()
        {
            var d = GetRandom.Object <MeasureTermData>();

            obj = new testClass(d);
            Assert.AreEqual(d.Power, obj.Power);
        }
Пример #3
0
        public void SerializationTest()
        {
            var tc = new testClass
            {
                Active               = true,
                Guid                 = Guid.NewGuid(),
                LastModifiedBy       = Guid.NewGuid(),
                LastModifiedDateTime = DateTime.Now,
                ParentGuid           = Guid.NewGuid(),
                PersistedDateTime    = DateTime.Now,
                VersionGuid          = Guid.NewGuid(),
                VersionTimeStamp     = DateHelper.GetCurrentTimeStamp()
            };

            TGSerializedObject tg = tc.GetTGSerializedObject();
            var newTc             = TGSerializedObject.GetTGSerializable <testClass>(tg);

            Assert.AreEqual(tc.Active, newTc.Active);
            Assert.AreEqual(tc.Guid, newTc.Guid);
            Assert.AreEqual(tc.LastModifiedBy, newTc.LastModifiedBy);
            Assert.AreEqual(tc.LastModifiedDateTime, newTc.LastModifiedDateTime);
            Assert.AreEqual(tc.ParentGuid, newTc.ParentGuid);
            Assert.AreEqual(tc.PersistedDateTime, newTc.PersistedDateTime);
            Assert.AreEqual(tc.VersionGuid, newTc.VersionGuid);

            Assert.LessOrEqual(tc.VersionTimeStamp, newTc.VersionTimeStamp);
        }
Пример #4
0
    void Start()
    {
        string json  = JsonUtility.ToJson(asd);
        string json2 = JsonUtility.ToJson(asd1);


        if (!Directory.Exists("TestJson"))
        {
            Directory.CreateDirectory("TestJson");
        }
        string path = "TestJson/test.json";



        //Write some text to the test.txt file
        StreamWriter writer = new StreamWriter(path, false);

        writer.WriteLine(json);
        writer.WriteLine(json2);

        writer.Close();


        //Read the text from directly from the test.txt file
        StreamReader reader = new StreamReader(path);

        asd2 = JsonUtility.FromJson <testClass>(reader.ReadLine());
        asd3 = JsonUtility.FromJson <testClass>(reader.ReadLine());
        reader.Close();
    }
Пример #5
0
    public bool PosTest1()
    {
        bool retVal = true;
        Type tpA;
        int ActualResult;

        TestLibrary.TestFramework.BeginScenario("PosTest1: normal Type get hash code");
        try
        {
            tpA = typeof(testClass);
            ActualResult = tpA.GetHashCode();
            testClass tc = new testClass(ActualResult);
            if (ActualResult != tc.GetHashCode())
            {
                TestLibrary.TestFramework.LogError("001", "the ActualResult is not the ExpectResult");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("002", "Unexpect exception:" + e);
            retVal = false;
        }
        return retVal;

    }
Пример #6
0
        static void Main(string[] args)
        {
            ServerTcp serverTcp = new ServerTcp();

            testClass program = new testClass();

            // LocalMethod(); // локальный метод
            //PoluchenieTupeClassa();

            //запуск делегата
            // zapuskLambaMetoda(10, 10);
            //zapuskLambaMetoda(25, 25);

            //булевские значения
            // zapuskBollDelegata(true);
            //zapuskBollDelegata(false);

            // sravnenieIntCouts(11,12);
            // sravnenieIntCouts(10,10);

            //Запись файла
            // RabSFiles();

            // запуск сервера прошлушки порта и сокета

            serverTcp.ZapuskServera();
        }
Пример #7
0
        public void parseClassShouldWork()
        {
            //Data
            testClass tester = new testClass();

            testComp.Add("boolTest", TableRep.DType.boolean);
            testComp.Add("byteTest", TableRep.DType.Tint);
            testComp.Add("shortTest", TableRep.DType.Sint);
            testComp.Add("intTest", TableRep.DType.Rint);
            testComp.Add("longTest", TableRep.DType.Lint);
            testComp.Add("decimalTest", TableRep.DType.dec);
            testComp.Add("doubleTest", TableRep.DType.dec);
            testComp.Add("charTest", TableRep.DType.ch);
            testComp.Add("sbyteTest", TableRep.DType.Rint);
            testComp.Add("ushortTest", TableRep.DType.Rint);
            testComp.Add("uintTest", TableRep.DType.Rint);
            testComp.Add("ulongTest", TableRep.DType.Lint);
            testComp.Add("stringTest", TableRep.DType.vchar);

            TableRep testTable = new TableRep();

            testTable.setColumns(testComp);
            testTable.setTableName("tester");
            TableRep comp = ParseClass.parseClass(tester);

            comp.setTableName("tester");

            Assert.Equal(testTable.getColumns(), comp.getColumns());
            Assert.Equal(testTable.getTableName(), comp.getTableName());
        }
Пример #8
0
        public void DataTest()
        {
            var d = GetRandom.Object <MeasureData>(); //annad data testile ja pead prst selle saama!

            Assert.AreNotSame(d, obj.Data);
            obj = new testClass(d);
            Assert.AreSame(d, obj.Data);
        }
Пример #9
0
    // Main Method
    public static void Main_Method()
    {
        // Creating object
        testClass t = new testClass();

        // calling method
        t.display();
    }
        public void OnModelCreatingTest()
        {
            var o       = new DbContextOptions <EventProjectDbContext>();
            var context = new testClass(o);
            var mb      = context.RunOnModelCreating();

            testHasEventProfileEntities(mb);
        }
Пример #11
0
        public override void TestInitialize()
        {
            base.TestInitialize();
            var r = new TestRepositoryForUniqueEntity();
            var t = new termRepository();

            obj = new testClass(r, t);
        }
Пример #12
0
 public override void TestInitialize()
 {
     base.TestInitialize();
     type = typeof(IsReadOnly);
     o    = new testClass {
         A = "", C = ""
     };
 }
Пример #13
0
        public override void TestInitialize()
        {
            base.TestInitialize();
            var options = new DbContextOptionsBuilder <AirFreightDbContext>().Options;
            var c       = new AirFreightDbContext(options);

            obj = new testClass(c, c.America);
        }
Пример #14
0
        public void DataTest()//можно ли че то дать конструктору
        {
            var d = GetRandom.Object <MeasureData>();

            Assert.AreNotSame(d, obj.Data);
            obj = new testClass(d);
            Assert.AreSame(d, obj.Data);
        }
Пример #15
0
        public override void TestInitialize()
        {
            base.TestInitialize(); //kasutab inmemorydb extensionit, mis on malus!
            var options = new DbContextOptionsBuilder <QuantityDbContext>().UseInMemoryDatabase("TestDb").Options;
            var c       = new QuantityDbContext(options);

            obj = new testClass(c, c.Measures);
        }
Пример #16
0
        public void CanMapClassWithProperties()
        {
            var c = new testClass {
                y = 2
            };

            Assert.IsTrue(intStruct.CanBeAssignedFromType(c.GetType()));
        }
Пример #17
0
        public override void TestInitialize()
        {
            base.TestInitialize(); //kasutab inmemorydb extensionit, mis on malus!
            var r = new testRepository();
            var t = new termRepository();

            obj = new testClass(r, t); //annan repository katte
        }
Пример #18
0
        public override void TestInitialize()
        {
            base.TestInitialize();
            var options = new DbContextOptionsBuilder <QuantityDbContext>().UseInMemoryDatabase("TestDB").Options;
            var c       = new QuantityDbContext(options);

            obj = new testClass(c, c.Measures);
        }
Пример #19
0
    // Use this for initialization
    void Start()
    {
        print(testVal.GetType());
        print(testVal.GetType() == typeof(int));
        testClass testInstance = new testClass();

        print(testInstance.GetType());
        print(testInstance.GetType() == typeof(testClass));
    }
Пример #20
0
        public void CanSetNullDataTest()
        {
            var d = GetRandom.Object <MeasureData>();

            obj = new testClass(d);
            Assert.IsNotNull(obj.Data);
            obj.Data = null;
            Assert.IsNull(obj.Data);
        }
Пример #21
0
 public override void TestInitialize()
 {
     base.TestInitialize();
     obj = new testClass {
         F = DateTime.MaxValue, T = DateTime.MinValue
     };
     x = GetRandom.String();
     y = GetRandom.String();
 }
Пример #22
0
        public void OnModelCreatingTest()
        {
            var o       = new DbContextOptions <SentryDbContext>();
            var context = new testClass(o);
            var mb      = context.RunOnModelCreating();

            testHasCustomersEntities(mb);
            testHasGoodsEntities(mb);
        }
Пример #23
0
        public void OnModelCreatingTest()
        {
            var o       = new DbContextOptions <SentryDbContext>();
            var context = new testClass(o);
            var mb      = context.RunOnModelCreating();

            testHasAddressEntities(mb);
            testHasCountryCurrencyEntities(mb);
            testOtherTelecomRegistrationEntities(mb);
        }
Пример #24
0
        [TestMethod] public void OnModelCreatingTest()
        {
            var o       = new DbContextOptions <ApplicationDbContext>();
            var context = new testClass(o);
            var mb      = context.RunOnModelCreating();

            /*testHasAdressEntities(mb);
             * testHasNationalCurrencyEntities(mb);
             * testOtherTelecomRegistrationEntities(mb);*/
        }
Пример #25
0
public static void Main()
{
Console.WriteLine("Entering Main");
testClass t1 = new testClass("1");
testClass t2 = new testClass("2");
testClass t3  = new testClass("3");
t1.th.Join();
Console.WriteLine("first joined");
t2.th.Join();
Console.WriteLine("second joined");
t3.th.Join();
Console.WriteLine("Third joined");
Console.WriteLine("exiting main");
}