public async void All() { Mock <ILogger <SaleTicketsRepository> > loggerMoc = SaleTicketsRepositoryMoc.GetLoggerMoc(); ApplicationDbContext context = SaleTicketsRepositoryMoc.GetContext(); var repository = new SaleTicketsRepository(loggerMoc.Object, context); var records = await repository.All(); records.Should().NotBeEmpty(); records.Count.Should().Be(1); }
public async void All() { Mock <ILogger <SaleTicketsRepository> > loggerMoc = SaleTicketsRepositoryMoc.GetLoggerMoc(); ApplicationDbContext context = SaleTicketsRepositoryMoc.GetContext(); var repository = new SaleTicketsRepository(loggerMoc.Object, context); SaleTickets entity = new SaleTickets(); context.Set <SaleTickets>().Add(entity); await context.SaveChangesAsync(); var record = await repository.All(); record.Should().NotBeEmpty(); }