public void OpenRides() { foreach (var ride in rideRepo.All().Where(ride => ride.Status.Equals(RideStatus.Closed))) { ride.ToOpen(); logger.LogInformation($"Ride {ride.Name} opened"); CheckRequiredEmployees(ride); } }
public void All_GivenRepoHasTwoLocations_ExpectTwoLocations() { ConcurrentBag <LocationImpl> locations = repo.All(); Assert.NotEmpty(locations); Assert.Equal(2, locations.Count); }
public string PlaceOrder(Guid standGuid, List <string> products) { var stand = standRepo.All().First(s => s.Guid.Equals(standGuid)); var dinner = new Dinner( stand.Meals.FindAll(meal => products.Contains(meal.Name)), stand.Drinks.FindAll(drink => products.Contains(drink.Name)) ); if (!dinner.IsValid()) { logger.Log(LogLevel.Error, $"Could not place order for {dinner.ToString()}"); throw new InvalidOperationException($"Dinner is invalid: {dinner.ToString()}"); } var ticket = Guid.NewGuid(); var dateTime = GetDinnerDoneDateTime(); openDinnerOrders.Add(ticket, dinner); ordersDoneAtTime.Add(ticket, dateTime); logger.Log(LogLevel.Debug, $"Placed order at stand {stand.Name} with ticket {ticket}, " + $"done at {dateTime}"); return(ticket.ToString()); }
public StandControl(ILogger <StandControl> logger, IEventProducer eventProducer, ILocationService locationService) { this.logger = logger; this.eventProducer = eventProducer; standRepo = new LocationRepository <Stand>(locationService, new LocationConverter <Stand>((x) => new Stand(x))); locationService.CalculateLocationDistances(standRepo.All()); }
public RideControl(ILogger <RideControl> logger, IEventProducer eventProducer, IVisitorClient visitorClient, ILocationService locationService) { rideRepo = new LocationRepository <Ride>(locationService, new LocationConverter <Ride>((x) => new Ride(x))); this.logger = logger; this.eventProducer = eventProducer; this.visitorClient = visitorClient; locationService.CalculateLocationDistances(rideRepo.All()); }
public FairyTaleControl(ILogger <FairyTaleControl> logger, IEventProducer eventProducer, ILocationService locationService) { taleRepo = new LocationRepository <FairyTale>(locationService, new LocationConverter <FairyTale>((obj) => new FairyTale(obj))); this.logger = logger; this.eventProducer = eventProducer; locationService.CalculateLocationDistances(taleRepo.All()); }
public StandControl(ILogger <StandControl> logger, IEventProducer eventProducer, Dictionary <Guid, Dinner> openDinnerOrders, Dictionary <Guid, DateTime> ordersDoneAtTime, ILocationService locationService) { this.logger = logger; this.eventProducer = eventProducer; this.openDinnerOrders = openDinnerOrders; this.ordersDoneAtTime = ordersDoneAtTime; standRepo = new LocationRepository <Stand>(locationService, new LocationConverter <Stand>((x) => new Stand(x))); locationService.CalculateLocationDistances(standRepo.All()); }