コード例 #1
0
        public void GetEntities_Args_Filtered()
        {
            var unitOfWork = new MemoryUnitOfWork();
            var repository = new MemoryDomainServiceBaseStubRepository(unitOfWork);
            repository.Add(new DomainEntityBaseStub());
            repository.Add(new DomainEntityBaseStub());
            unitOfWork.Commit();

            var target = new DomainServiceBaseStub(repository, unitOfWork);
            var actual = target.GetEntitiesStub();
            Assert.AreEqual(2, actual.TotalCount);
        }
コード例 #2
0
        public void Count_NoArgs_CountAllEntities()
        {
            var unitOfWork = new MemoryUnitOfWork();
            var repository = new MemoryDomainServiceBaseStubRepository(unitOfWork);
            repository.Add(new DomainEntityBaseStub());
            repository.Add(new DomainEntityBaseStub());
            unitOfWork.Commit();

            var target = new DomainServiceBaseStub(repository, unitOfWork);
            var actual = target.Count();
            Assert.AreEqual(2, actual);
        }