Пример #1
0
 public void Delete_Test()
 {
     try
     {
         busClock.SaveChanges(ADOClock1, UIActionType.DELETE);
         ClearSession();
         clock_testObject = busClock.GetByID(ADOClock1.ID);
         Assert.Fail();
     }
     catch (ItemNotExists ex)
     {
         Assert.Pass();
     }
 }
Пример #2
0
        public void TestSetup()
        {
            busClock         = new BClock();
            clock_testObject = new global::GTS.Clock.Model.BaseInformation.Clock();

            clockTypeTA.Insert("00-0Test1", "TestClockType1");
            decimal?clockTypeId = clockTypeTA.GetLastId();

            decimal?stationId = ADOStaion1.ID;

            clockTA.Insert("TestClock1", "00-0Test1", clockTypeId, stationId, "", true);
            DatabaseGateway.TA_ClockDataTable clockTable = clockTA.GetDataByCode("00-0Test1");
            DatabaseGateway.TA_ClockRow       row        = clockTable.Rows[0] as DatabaseGateway.TA_ClockRow;
            ADOClock1.ID         = row.clock_ID;
            ADOClock1.Name       = row.clock_Name;
            ADOClock1.Tel        = row.clock_Tel;
            ADOClock1.CustomCode = row.clock_CustomCode;
            ADOClock1.Station    = new global::GTS.Clock.Model.BaseInformation.ControlStation()
            {
                ID = (decimal)stationId
            };
            ADOClock1.Clocktype = new global::GTS.Clock.Model.BaseInformation.ClockType()
            {
                ID = (decimal)clockTypeId
            };

            clockTA.Insert("TestClock2", "00-0Test2", clockTypeId, stationId, "", true);
            clockTable           = clockTA.GetDataByCode("00-0Test2");
            row                  = clockTable.Rows[0] as DatabaseGateway.TA_ClockRow;
            ADOClock2.ID         = row.clock_ID;
            ADOClock2.Name       = row.clock_Name;
            ADOClock2.Tel        = row.clock_Tel;
            ADOClock2.CustomCode = row.clock_CustomCode;
            ADOClock2.Station    = new global::GTS.Clock.Model.BaseInformation.ControlStation()
            {
                ID = (decimal)stationId
            };
            ADOClock2.Clocktype = new global::GTS.Clock.Model.BaseInformation.ClockType()
            {
                ID = (decimal)clockTypeId
            };
        }
Пример #3
0
 public void GetById_Test()
 {
     clock_testObject = busClock.GetByID(ADOClock1.ID);
     ClearSession();
     Assert.AreEqual(ADOClock1.Name, clock_testObject.Name);
 }