public StatisticsServiceTests() { _tolkDbContext = CreateTolkDbContext(); _clock = new StubSwedishClock(DateTimeOffset.Now.ToString()); var mockLanguages = MockEntities.MockLanguages; var mockRankings = MockEntities.MockRankings; var mockCustomers = MockEntities.MockCustomers; var mockCustomerUsers = MockEntities.MockCustomerUsers(mockCustomers); var mockOrders = MockEntities.MockOrders(mockLanguages, mockRankings, mockCustomerUsers); var mockRequisitions = MockEntities.MockRequisitions(mockOrders); var mockComplaints = MockEntities.MockComplaints(mockOrders); var regions = Region.Regions; //Initialize data if not already initialized if (!_tolkDbContext.CustomerOrganisations.Any()) { _tolkDbContext.AddRange(mockCustomers); _tolkDbContext.AddRange(mockCustomerUsers); _tolkDbContext.AddRange(mockLanguages); _tolkDbContext.AddRange(mockRankings); _tolkDbContext.AddRange(mockOrders); _tolkDbContext.AddRange(mockRequisitions); _tolkDbContext.AddRange(mockComplaints); _tolkDbContext.AddRange(regions); } _tolkDbContext.SaveChanges(); _statService = new StatisticsService(_tolkDbContext, _clock); }
public RequisitionFilterModelTests() { mockLanguages = MockEntities.MockLanguages; var mockRankings = MockEntities.MockRankings; var mockCustomerUsers = MockEntities.MockCustomerUsers(MockEntities.MockCustomers); var mockOrders = MockEntities.MockOrders(mockLanguages, mockRankings, mockCustomerUsers); mockRequisitions = MockEntities.MockRequisitions(mockOrders); }
public AssignmentFilterModelTests() { _clock = new StubSwedishClock("2018-09-03 12:57:14"); mockLanguages = MockEntities.MockLanguages; var mockRankings = MockEntities.MockRankings; var mockCustomerUsers = MockEntities.MockCustomerUsers(MockEntities.MockCustomers); var mockOrders = MockEntities.MockOrders(mockLanguages, mockRankings, mockCustomerUsers); var mockRequisitions = MockEntities.MockRequisitions(mockOrders); mockOrders = MockEntities.LinkRequisitionsInOrdersRequests(mockOrders, mockRequisitions); mockRequests = MockEntities.GetRequestsFromOrders(mockOrders); }