public RestaurantsController(IRestaurantContext restaurantContext) { _restaurantContext = restaurantContext; }
public RestaurantRepository(IRestaurantContext context) { Context = context; }
public RestaurantController(IConfiguration config) { context = new RestaurantMSSQLContext(config.GetConnectionString("DefaultConnection")); rep = new RestaurantRepository(context); }
public RestaurantRepository(IRestaurantContext context, IMapper mapper) { _context = context; _mapper = mapper; }
private void VerifyResults(List<string> expectedTableNumber, string expectedOrderStatus, IRestaurantContext context) { Type type = context.GetType(); PropertyInfo[] properties = type.GetProperties(); foreach (PropertyInfo property in properties) { if (property == null) continue; bool isEnumerable = (from i in property.PropertyType.GetInterfaces() where i == typeof(IEnumerable) select i ).Any(); if (!isEnumerable) continue; try { if (property.Name.Contains("customerOrders")) { int i = 0; foreach (CustomerOrder custOrder in (IEnumerable)property.GetValue(context, null)) { string ss = custOrder.StartTime.ToLongTimeString(); string tableNumber = custOrder.TableNumber; NUnit.Framework.Assert.AreEqual(expectedTableNumber[i], tableNumber); NUnit.Framework.Assert.AreEqual(expectedOrderStatus, ((OrderStatus)custOrder.Status).ToString()); foreach (ItemOrderXRef item in custOrder.Items) { NUnit.Framework.Assert.AreEqual(custOrder.CustomerOrderId, item.CustomerOrderId); } i++; } break; } } catch (Exception ex) { string error = ex.Message; if (ex.InnerException != null) error += ex.InnerException.Message; NUnit.Framework.Assert.Fail(error); } } }
public void Initialize() { fakeRestaurantContext = new FakeRestaurantContext(); }
public void CleanUp() { fakeRestaurantContext = null; }
public WaiterBL(IRestaurantContext Context) { this.context = DbContextHelper.GetRestaurantContext(Context); }
public RestaurantController() { context = new RestaurantMSSQLContext(); rep = new RestaurantRepository(context); }