Beispiel #1
0
        public async Task CanTestIfEmpty()
        {
            RepoUtil.Reset(_repo);
            var isEmpty = await _repo.IsEmpty();

            Assert.True(isEmpty);

            await _repo.AddScope(ObjectMother.CreateScopeDocument("myscope"));

            isEmpty = await _repo.IsEmpty();

            Assert.False(isEmpty);
        }
Beispiel #2
0
        public async Task CanGetAll()
        {
            RepoUtil.Reset(_repo);

            await _repo.AddScope(ObjectMother.CreateScopeDocument("scope1"));

            await _repo.AddScope(ObjectMother.CreateScopeDocument("scope2"));

            await _repo.AddScope(ObjectMother.CreateScopeDocument("scope3"));

            var result = await _repo.GetAllScopes();

            Assert.AreEqual(3, result.Count());
        }
        public async Task CanGetAll()
        {
            RepoUtil.Reset(_repo);

            await _repo.AddClient(ObjectMother.CreateClientDocument("id1"));

            await _repo.AddClient(ObjectMother.CreateClientDocument("id2"));

            await _repo.AddClient(ObjectMother.CreateClientDocument("id3"));

            var result = await _repo.GetAllClients();

            Assert.AreEqual(3, result.Count());
        }
 private void Reset()
 {
     RepoUtil.Reset <T>(_repo as RepositoryBase <T>);
 }
Beispiel #5
0
 public ScopeRepositoryTests()
 {
     _repo = new ScopeRepository(TestFactory.SharedCollection, TestFactory.CreateConnectionSettings());
     RepoUtil.Reset(_repo);
 }