public void TestNext_ReturnCorrect() { JourneyRepository repo = new JourneyRepository(new ListManagerJourney()); var startDate = new DateTime(2018, 01, 01); repo.Add(new Journey("test", "test", 0, 0, startDate, startDate.AddDays(7))); startDate = DateTime.Now; repo.Add(new Journey("test", "test", 0, 0, startDate, startDate.AddDays(7))); startDate = startDate.AddDays(6); var journey = new Journey("test", "test", 0, 0, startDate, startDate.AddDays(7)); repo.Add(journey); Assert.AreEqual(journey, repo.Next()); }
private static Journey SeedJourney(PreservationContext dbContext, string plant, string title) { var journeyRepository = new JourneyRepository(dbContext); var journey = new Journey(plant, title); journeyRepository.Add(journey); dbContext.SaveChangesAsync().Wait(); return(journey); }
public App() { Journeys = new JourneyRepository(new ListManagerJourney()); for (int i = 0; i < 11; i++) { DateTime start = new DateTime(2018, 02, 01); start = start.AddMonths(i); Journeys.Add(new Journey("Göteborg", "Tur i hamnen", 10, 5, start, start.AddDays(7))); } }