示例#1
0
        public async void All()
        {
            Mock <ILogger <TeamRepository> > loggerMoc = TeamRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext             context   = TeamRepositoryMoc.GetContext();
            var repository = new TeamRepository(loggerMoc.Object, context);
            var records    = await repository.All();

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

            Team entity = new Team();

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

            var record = await repository.All();

            record.Should().NotBeEmpty();
        }