Пример #1
0
        public void AddItemListInvalidItem()
        {
            //Arrange
            DataBaseContext     db           = new DataBaseContext();
            IItemListRepository itemListRepo = new ItemListRepository(db);
            Guid     userID = new Guid("FB8A70A1-056B-E911-AA03-021598E9EC9E");
            Guid     itemID = new Guid();
            ItemList il     = new ItemList(userID, itemID);

            //Act => Assert
            Assert.ThrowsException <DbUpdateException>(() => itemListRepo.AddItemList(il));
        }
Пример #2
0
        public void addItemListInvalidItem()
        {
            //Arrange
            DataBaseContext     db           = new DataBaseContext();
            IItemListRepository itemListRepo = new ItemListRepository(db);
            Guid     userID = new Guid("7DF91B37-DC4A-E911-8259-0A64F53465D0");
            Guid     itemID = new Guid();
            ItemList il     = new ItemList(userID, itemID);

            //Act => Assert
            Assert.ThrowsException <DbUpdateException>(() => itemListRepo.AddItemList(il));
        }
Пример #3
0
        public void addItemListValidUserItem()
        {
            //Arrange
            DataBaseContext     db           = new DataBaseContext();
            IItemListRepository itemListRepo = new ItemListRepository(db);
            Guid     userID = new Guid("7DF91B37-DC4A-E911-8259-0A64F53465D0");
            Guid     itemID = new Guid("85F91B37-DC4A-E911-8259-0A64F53465D0");
            ItemList il     = new ItemList(userID, itemID);

            //Act
            itemListRepo.AddItemList(il);
            ItemList newIl = itemListRepo.GetItemList(userID, itemID);

            //Assert
            Assert.IsNotNull(newIl);
        }
Пример #4
0
        public void AddItemListValidUserItem()
        {
            //Arrange
            DataBaseContext     db           = new DataBaseContext();
            IItemListRepository itemListRepo = new ItemListRepository(db);
            Guid     userID = new Guid("FB8A70A1-056B-E911-AA03-021598E9EC9E");
            Guid     itemID = new Guid("4B361F37-036B-E911-AA03-021598E9EC9E");
            ItemList il     = new ItemList(userID, itemID);

            //Act
            itemListRepo.AddItemList(il);
            ItemList newIl = itemListRepo.GetItemList(userID, itemID);

            //Assert
            Assert.IsNotNull(newIl);
        }