Exemplo n.º 1
0
        public void TestDb_Create_AddsToDb()
        {
            DbSetUp();
            ReviewsController controller     = new ReviewsController(db);
            ItemsController   itemController = new ItemsController(dbItem);
            Item testItem = new Item {
                ItemId = 7, Description = "Gummi Bears!", Name = "Gummi Bears", Cost = 1
            };
            Review testReview = new Review {
                ReviewId = 1, Body = "A Review", Rating = 4, UserName = "******", ItemId = 2
            };

            itemController.Create(testItem);
            controller.Create(testReview);
            var collection = (controller.Index() as ViewResult).ViewData.Model as List <Review>;

            CollectionAssert.Contains(collection, testReview);
            db.RemoveAll();
        }
 public void Dispose()
 {
     db.RemoveAll();
     db2.RemoveAll();
 }
Exemplo n.º 3
0
 public void Dispose()
 {
     db.RemoveAll();
     dbProduct.RemoveAll();
 }
Exemplo n.º 4
0
 public void Dispose()
 {
     db.RemoveAll();
     reviewDb.RemoveAll();
 }