public static void SetUp(TestContext context) { _unitOfWork = new UnitOfWork(); _memberDecorator = new MemberDecorator(new MemberFactory(), _unitOfWork.MemberRepository); _friendDecorator = new FriendDecorator(new FriendFactory(), _unitOfWork.FriendRepository); _member1 = _memberDecorator.CreateMember("*****@*****.**"); _member2 = _memberDecorator.CreateMember("*****@*****.**"); _friend = _friendDecorator.CreateFriend(_member1, _member2); }
public static void SetUp(TestContext context) { _unitOfWork = new UnitOfWork(); _memberDecorator = new MemberDecorator(new MemberFactory(), _unitOfWork.MemberRepository); _friendDecorator = new FriendDecorator(new FriendFactory(), _unitOfWork.FriendRepository); _member1 = _memberDecorator.CreateMember(Guid.NewGuid().ToString()); _member2 = _memberDecorator.CreateMember(Guid.NewGuid().ToString()); _friend = _friendDecorator.CreateFriend(_member1, _member2); _oldCount = _friendDecorator.Count(); _memberDecorator.Add(_member1); _memberDecorator.Add(_member2); _friendDecorator.Add(_friend); _unitOfWork.PersistAll(); using (var uow = new UnitOfWork()) { _newCount = uow.FriendRepository.Count(); _loadedFriend = uow.FriendRepository.Get(_friend.Id); } }