public PreceptorTimeContextFactory() { //Notice that we are building ContextOptions using Guid.NewGuid().ToString() property as a database //name in order to provide a new, clean in-memory instance for each test class. var contextOptions = new DbContextOptionsBuilder <PreceptorTimeContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()) .EnableSensitiveDataLogging() .Options; EnsureCreation(contextOptions); ContextInstance = new TestPreceptorTimeContext(contextOptions); ReportMapper = new ReportMapper(); UserInfoMapper = new UserInfoMapper(); UserMapper = new UserMapper(); TimeEntryMapper = new TimeEntryMapper(UserMapper); }
public TimeEntryService(ITimeEntryMapper mapper, ITimeEntryRepository repo) { _mapper = mapper; _repo = repo; }