public async void All()
        {
            Mock <ILogger <HandlerRepository> > loggerMoc = HandlerRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = HandlerRepositoryMoc.GetContext();
            var repository = new HandlerRepository(loggerMoc.Object, context);
            var records    = await repository.All();

            records.Should().NotBeEmpty();
            records.Count.Should().Be(1);
        }
Esempio n. 2
0
        public async void All()
        {
            Mock <ILogger <HandlerRepository> > loggerMoc = HandlerRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = HandlerRepositoryMoc.GetContext();
            var repository = new HandlerRepository(loggerMoc.Object, context);

            Handler entity = new Handler();

            context.Set <Handler>().Add(entity);
            await context.SaveChangesAsync();

            var record = await repository.All();

            record.Should().NotBeEmpty();
        }