Пример #1
0
        public async void All()
        {
            Mock <ILogger <TransactionRepository> > loggerMoc = TransactionRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = TransactionRepositoryMoc.GetContext();
            var repository = new TransactionRepository(loggerMoc.Object, context);
            var records    = await repository.All();

            records.Should().NotBeEmpty();
            records.Count.Should().Be(1);
        }
        public async void All()
        {
            Mock <ILogger <TransactionRepository> > loggerMoc = TransactionRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = TransactionRepositoryMoc.GetContext();
            var repository = new TransactionRepository(loggerMoc.Object, context);

            Transaction entity = new Transaction();

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

            var record = await repository.All();

            record.Should().NotBeEmpty();
        }