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

            records.Should().NotBeEmpty();
            records.Count.Should().Be(1);
        }
示例#2
0
        public async void All()
        {
            Mock <ILogger <LinkStatusRepository> > loggerMoc = LinkStatusRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = LinkStatusRepositoryMoc.GetContext();
            var repository = new LinkStatusRepository(loggerMoc.Object, context);

            LinkStatus entity = new LinkStatus();

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

            var record = await repository.All();

            record.Should().NotBeEmpty();
        }