public void Setup() { AutoMapperConfig.RegisterMappings( typeof(PCCUser).Assembly.GetTypes(), typeof(PartServiceModel).Assembly.GetTypes()); DbContextOptions <PCCDbContext> options = new DbContextOptionsBuilder <PCCDbContext>() .UseInMemoryDatabase($"TESTS-DB-{Guid.NewGuid().ToString()}") .Options; this.pCCDbContext = new PCCDbContext(options); this.partService = new PartsService(this.pCCDbContext); }
public PartsService(PCCDbContext pCCDbContext) { this.pCCDbContext = pCCDbContext; }