Esempio n. 1
0
        public void GetMembers_ReturnCount()
        {
            using (var transaction = _dbFixture.Connection.BeginTransaction())
            {
                var memberService = new EFTeamService(_dbFixture.CreateContext(transaction), new NullLogger <EFTeamService>(), _mapper);
                var testMembers   = memberService.GetMembers <AdminMemberDto>().Result;

                Assert.True(testMembers.Successful);
                Assert.True(testMembers.Data.Count > 0);
            }
        }
Esempio n. 2
0
        public void GetMembers_ReturnErrorOnEmptyDb()
        {
            using (var transaction = _dbFixture.Connection.BeginTransaction())
            {
                var context = _dbFixture.CreateContext(transaction);
                _dbFixture.ClearDb(context);

                var memberService = new EFTeamService(context, new NullLogger <EFTeamService>(), _mapper);
                var membersResult = memberService.GetMembers <AdminMemberDto>().Result;
                Assert.False(membersResult.Data.Any());
            }
        }