public virtual void ReadEntityWithOneToManyLaterAdded() { using (var collection = CreateTransactionalCollection()) { using (var unitOfWork = new SchoolUnitOfWork(collection)) { unitOfWork.SchoolRepository.Save(Known.Schools.SchoolWithOneChild); unitOfWork.SchoolRepository.Commit(); } } using (var collection = CreateTransactionalCollection()) { using (var unitOfWork = new SchoolUnitOfWork(collection)) { unitOfWork.ChildOnlyRepository.Count() .Should().Be.EqualTo(Known.Schools.SchoolWithOneChild.Children.Count); } } }
public virtual void AddEntityAndGet() { using (var collection = CreateTransactionalCollection()) { using (var unitOfWork = new SchoolUnitOfWork(collection)) { unitOfWork.SchoolRepository.Save(Known.Schools.School); unitOfWork.SchoolRepository.Commit(); } } using (var collection = CreateTransactionalCollection()) { using (var unitOfWork = new SchoolUnitOfWork(collection)) { unitOfWork.SchoolRepository.Single() .Name.Should().Be.EqualTo(Known.Schools.School.Name); } } }