public void RejectMenu() { Admin admin = new Admin(Context); SelectMenuIfNotSelected(admin); var menu = Context.GetSelectedMenuForToday(); TestEntity.AcceptMenu(menu); TestEntity.RejectMenu(menu); Assert.IsFalse(menu.Orders.First().Details.Any(x => x.User == TestEntity), "If user accepted menu, than rejected OrderDetail should be removed"); }
public void AcceptMenu() { Admin admin = new Admin(Context); SelectMenuIfNotSelected(admin); var menu = Context.GetSelectedMenuForToday(); TestEntity.AcceptMenu(menu); Assert.AreNotEqual(0, menu.Orders.Count, "We can't choose menu if admin doesn't create order"); var order = menu.Orders.First(); Assert.AreNotEqual(0, order.Details.Count, "If some user choosed menu, than Order.OrderDetail can't be 0"); Assert.IsTrue(order.Details.Any(x => x.User == TestEntity), "If user accepted menu, than OrderDetail should contain info about this"); Assert.AreEqual(1, order.PeopleCount, "Pepople count should be 1 because 1 user accepted menu"); }