コード例 #1
0
        public async void All()
        {
            Mock <ILogger <CommentRepository> > loggerMoc = CommentRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = CommentRepositoryMoc.GetContext();
            var repository = new CommentRepository(loggerMoc.Object, context);
            var records    = await repository.All();

            records.Should().NotBeEmpty();
            records.Count.Should().Be(1);
        }
コード例 #2
0
        public async void AllWithSearch()
        {
            Mock <ILogger <CommentRepository> > loggerMoc = CommentRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = CommentRepositoryMoc.GetContext();
            var repository = new CommentRepository(loggerMoc.Object, context);

            var records = await repository.All(1, 0, DateTime.Parse("1/1/1987 12:00:00 AM").ToString());

            records.Should().NotBeEmpty();
            records.Count.Should().Be(1);
        }
コード例 #3
0
        public async void All()
        {
            Mock <ILogger <CommentRepository> > loggerMoc = CommentRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = CommentRepositoryMoc.GetContext();
            var repository = new CommentRepository(loggerMoc.Object, context);

            Comment entity = new Comment();

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

            var record = await repository.All();

            record.Should().NotBeEmpty();
        }