예제 #1
0
        public void addobjTest()
        {
            Classlistvi dataretes = new Classlistvi();

            dataretes.store();
            int    corect   = 1;
            string code     = "100";
            int    vali     = 30;
            string name     = "nikolas";
            string price    = "1";
            string foto     = "C:/Users/strike xXx/Desktop/mixaniki/018510-glossy-black-3d-button-icon-symbols-shapes-power-button.png";
            string thesh    = "A2";
            string avalable = "1";

            dataretes.addnewobj(name, price, foto, thesh, avalable, code);
            dataretes.addobj(int.Parse(code), vali);
            dataretes.store();
            for (int i = 0; i < dataretes.len; i++)
            {
                if (dataretes.table[i, 5] == code & int.Parse(dataretes.table[i, 6]) == vali + 1)
                {
                    corect = 0;
                    break;
                }
            }
            dataretes.deleteitems(code);
            Assert.ReferenceEquals(0, corect);
        }
예제 #2
0
        public void addnewobjTest()
        {
            int         corect    = 1;
            string      name      = "nikolas";
            string      price     = "1";
            string      foto      = "C:/Users/strike xXx/Desktop/mixaniki/018510-glossy-black-3d-button-icon-symbols-shapes-power-button.png";
            string      thesh     = "A2";
            string      code      = "100";
            string      avalable  = "1";
            Classlistvi dataretes = new Classlistvi();

            dataretes.addnewobj(name, price, foto, thesh, avalable, code);
            dataretes.data();
            for (int i = 0; i < dataretes.len; i++)
            {
                if (dataretes.table[i, 1] == name & dataretes.table[i, 2] == price & dataretes.table[i, 3] == foto & dataretes.table[i, 4] == thesh & dataretes.table[i, 5] == code & dataretes.table[i, 6] == avalable)
                {
                    corect = 0;
                    //dataretes.deleteitems(dataretes.table[i, 0]);
                    break;
                }
            }
            dataretes.deleteitems(code);

            Assert.ReferenceEquals(0, corect);
        }