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