Exemplo n.º 1
0
        public void DeleteTest()
        {
            //Arrange
            db = new touch_for_foodEntities();
            CategoryOM target = new CategoryOM(db);
            int expected = 1;
            int actual;

            //Check Setup
            Assert.IsNotNull(db.categories.Find(category2.id));

            //Act
            actual = target.delete(category2.id);

            //Assert
            db = new touch_for_foodEntities();
            Assert.AreEqual(expected, actual);
            Assert.IsNull(db.categories.Find(category2.id));
        }
Exemplo n.º 2
0
        public void DeleteAssociationExistsExceptionItemTest()
        {
            //Arrange
            db = new touch_for_foodEntities();
            CategoryOM target = new CategoryOM(db);
            int actual;

            //Act
            actual = target.delete(category3.id);

            //Assert
            Assert.IsNotNull(db.categories.Find(category3.id));
            Assert.IsNotNull(db.items.Find(item1.id));
        }
Exemplo n.º 3
0
 public CategoryController()
 {
     im = new CategoryIM(db);
     om = new CategoryOM(db);
 }