Example #1
0
        public static void MyClassInitialize(TestContext testContext)
        {
            //Add test data (order specific)
            testDatabase = new TestDatabaseHelper();
            restaurant1 = testDatabase.AddRestaurant();
            table1 = testDatabase.AddTable(restaurant1);
            user1 = testDatabase.AddUser("*****@*****.**", table1, (int)SiteRoles.Customer);
            order1 = testDatabase.AddOrder(table1);
            item1 = testDatabase.AddItem();
            category1 = testDatabase.AddCategory();
            menu1 = testDatabase.AddMenu(restaurant1);
            menuCategory1 = testDatabase.AddMenuCategory(category1, menu1);
            menuItem1 = testDatabase.AddMenuItem(item1, menuCategory1);
            orderItem1 = testDatabase.AddOrderItem(order1, menuItem1);

            //Session
            db = new touch_for_foodEntities();
            ReviewController target = new ReviewController();
            Session session = new Session(db, target);
            session.simulateLogin(user1.username, user1.password);
        }
Example #2
0
 public void CreateTest()
 {
     ReviewController target = new ReviewController(); // TODO: Initialize to an appropriate value
     ReviewVM review = new ReviewVM(review1,order1); // TODO: Initialize to an appropriate value
     ActionResult expected = null; // TODO: Initialize to an appropriate value
     ActionResult actual;
     
     actual = target.Create(review);
     // Assert.AreEqual(expected, actual);
     Assert.IsNotNull(actual);
 }     
Example #3
0
 public void ReviewControllerConstructorTest()
 {
     ReviewController target = new ReviewController();
 }
Example #4
0
 public void DeleteTest()
 {
     ReviewController target = new ReviewController(); // TODO: Initialize to an appropriate value
     int id = review1.id; // TODO: Initialize to an appropriate value
     ActionResult expected = null; // TODO: Initialize to an appropriate value
     ActionResult actual;
     actual = target.Delete(id);
     Assert.IsNull(actual);
     //Assert.AreEqual(expected, actual);
 }
Example #5
0
 public void EditTest1()
 {
     ReviewController target = new ReviewController(); // TODO: Initialize to an appropriate value
     int id = review1.id; // TODO: Initialize to an appropriate value
     ActionResult expected = null; // TODO: Initialize to an appropriate value
     ActionResult actual;
     actual = target.Edit(id);
     Assert.IsNotNull(actual);
     //Assert.AreEqual(expected, actual);
     //Assert.Inconclusive("Verify the correctness of this test method.");
 }
Example #6
0
 public void EditTest()
 {
     ReviewController target = new ReviewController(); // TODO: Initialize to an appropriate value
     review review = review1; // TODO: Initialize to an appropriate value
     ActionResult expected = null; // TODO: Initialize to an appropriate value
     ActionResult actual;
     actual = target.Edit(review);
     //Assert.AreEqual(expected, actual);
     Assert.IsNotNull(actual);
 }
Example #7
0
 public void IndexTest()
 {
     ReviewController target = new ReviewController(); // TODO: Initialize to an appropriate value
     ViewResult expected = null; // TODO: Initialize to an appropriate value
     ViewResult actual;
     actual = target.Index();
     Assert.IsNotNull(actual);
     //Assert.AreEqual(expected, actual);
 }
Example #8
0
 public void CreateTest1()
 {
     ReviewController target = new ReviewController(); // TODO: Initialize to an appropriate value
     int orderID = order1.id; // TODO: Initialize to an appropriate value
     SelectList expected1 = new SelectList(Rating.GetRatings(), "Value", "Text");
     SelectList expected2 = new SelectList(Rating.GetRatings(), "Value", "Text");
     ActionResult actual;
     actual = (ActionResult)target.Create(orderID);
     Assert.IsNotNull(actual);
    // Assert.AreEqual("Index", actual.ToString());
     // Assert.Inconclusive("Verify the correctness of this test method.");
 }