예제 #1
0
        public void SelectCategory()
        {
            CategoryConnector sc = new CategoryConnector();

            Category result = sc.SelectCategory("book");

            Assert.AreEqual("book", result.CategoryName, "correct");
            //sc.DeleteCategory("book");
        }
예제 #2
0
        public void DeleteCategory()
        {
            CategoryConnector sc = new CategoryConnector();


            sc.DeleteCategory("hello");
            List <Category> result = sc.SelectAllCategory();

            Assert.AreEqual(0, result.Count, "correct");
        }
예제 #3
0
        public void InsertCategory()
        {
            CategoryConnector sc = new CategoryConnector();

            sc.InsertCategory("book", 4);
            List <Category> result = sc.SelectAllCategory();

            Assert.AreEqual("book", result[0].CategoryName, "correct");
            //sc.DeleteCategory("book");
        }
예제 #4
0
        public void UpdateCategory()
        {
            CategoryConnector sc = new CategoryConnector();


            sc.UpdateCategory("book", "hello", 5);
            List <Category> result = sc.SelectAllCategory();

            Assert.AreEqual("hello", result[0].CategoryName, "correct");
            Assert.AreEqual(5, result[0].Duration, "correct");
        }
예제 #5
0
        public void InsertItem()
        {
            ItemConnector     itemCn = new ItemConnector();
            CategoryConnector CateCn = new CategoryConnector();

            CateCn.InsertCategory("books", 4);
            itemCn.InsertItem("1231231", "hello", "books");
            Item item1 = itemCn.SelectItem("1231231");


            Assert.AreEqual("books", item1.ItemCategory.CategoryName, "correct");
            Assert.AreEqual("1231231", item1.Barcode, "correct");
            Assert.AreEqual("hello", item1.ItemDescription, "correct");
            Assert.AreEqual(true, item1.Status, "correct");
            //Assert.AreEqual("book", item1.ItemCategory, "correct");
            itemCn.DeleteItem("1231231");
            CateCn.DeleteCategory("books");
            Item item2 = itemCn.SelectItem("1231231");

            Assert.AreEqual(null, item2.Barcode, "correct");
        }