Exemplo n.º 1
0
        public void ThisServicePropertyOK()
        {
            ClsServiceCollection AllServices = new ClsServiceCollection();
            ClsService           TestItem    = new ClsService();

            TestItem.ServiceID          = 1;
            TestItem.ServiceName        = "MOT";
            TestItem.ServiceDescription = "Fix car";
            TestItem.ServicePrice       = 50;
            AllServices.ThisService     = TestItem;
            Assert.AreEqual(AllServices.ThisService, TestItem);
        }
Exemplo n.º 2
0
        public void ListAndCountOK()
        {
            ClsServiceCollection AllServices = new ClsServiceCollection();
            List <ClsService>    TestList    = new List <ClsService>();
            ClsService           TestItem    = new ClsService();

            TestItem.ServiceID          = 1;
            TestItem.ServiceName        = "MOT";
            TestItem.ServiceDescription = "Fix car";
            TestItem.ServicePrice       = 50;
            TestList.Add(TestItem);
            AllServices.ServiceList = TestList;
            Assert.AreEqual(AllServices.Count, TestList.Count);
        }
Exemplo n.º 3
0
        public void AddMethodOK()
        {
            ClsServiceCollection AllServices = new ClsServiceCollection();
            ClsService           AnService   = new ClsService();
            int PrimaryKey = 0;

            AnService.ServiceName        = "Vale";
            AnService.ServiceDescription = "sadf";
            AnService.ServicePrice       = 40;
            AllServices.ThisService      = AnService;
            PrimaryKey          = AllServices.Add();
            AnService.ServiceID = PrimaryKey;
            AllServices.ThisService.Find(PrimaryKey);
            Assert.AreEqual(AllServices.ThisService, AnService);
            AllServices.Delete();
        }
Exemplo n.º 4
0
        public void DeleteMethodOK()
        {
            ClsServiceCollection AllServices = new ClsServiceCollection();
            ClsService           AnService   = new ClsService();
            int PrimaryKey = 0;

            AnService.ServiceName        = "Vale";
            AnService.ServiceDescription = "sadf";
            AnService.ServicePrice       = 40;
            AllServices.ThisService      = AnService;
            PrimaryKey          = AllServices.Add();
            AnService.ServiceID = PrimaryKey;
            AllServices.ThisService.Find(PrimaryKey);
            AllServices.Delete();
            bool Found = AllServices.ThisService.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
Exemplo n.º 5
0
        public void InstanceOK()
        {
            ClsServiceCollection AllServices = new ClsServiceCollection();

            Assert.IsNotNull(AllServices);
        }