public ClienteRepositoryTest() { var optionsBuilder = new DbContextOptionsBuilder <ClContext>(); optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString()); context = new ClContext(optionsBuilder.Options); repository = new ClienteRepository(context); clienteFaker = new ClienteFaker(); cliente = clienteFaker.Generate(); }
public ClienteManagerTest() { repository = Substitute.For <IClienteRepository>(); logger = Substitute.For <ILogger <ClienteManager> >(); mapper = new MapperConfiguration(p => p.AddProfile <NovoClienteMappingProfile>()).CreateMapper(); manager = new ClienteManager(repository, mapper, logger); ClienteFaker = new ClienteFaker(); NovoClienteFaker = new NovoClienteFaker(); AlteraClienteFaker = new AlteraClienteFaker(); Cliente = ClienteFaker.Generate(); NovoCliente = NovoClienteFaker.Generate(); AlteraCliente = AlteraClienteFaker.Generate(); }