Example #1
0
        public TimeRegistrationServiceTests()
        {
            var builder = new DbContextOptionsBuilder <SimpleProjectTimeTrackerDbContext>();

            builder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            Options   = builder.Options;
            DbContext = new SimpleProjectTimeTrackerDbContext(builder.Options);
            DbContext.Database.EnsureCreated();
            DbContext.SeedDatabase();

            var config = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new MappingProfile());
            });

            Mapper = config.CreateMapper();

            Sut = new TimeRegistrationService(DbContext, Mapper);
        }