コード例 #1
0
        public async Task GetsTeamsSize()
        {
            using (var context = new ApplicationDbContext(_options))
            {
                context.Teams.AddRange(
                    new Team {
                    Id = 1
                },
                    new Team {
                    Id = 2
                },
                    new Team {
                    Id = 3
                });

                context.SaveChanges();
            }

            using (var context = new ApplicationDbContext(_options))
            {
                var teamsRepository = new TeamsRepository(context);

                var teamsSize = await teamsRepository.GetSize(null);

                Assert.Equal(3, teamsSize);
            }
        }