public static void SetUp(TestContext context)
        {
            _memberFactory = new MemberFactory();
            _friendFactory = new FriendFactory();

            _member = _memberFactory.CreateMember(Guid.NewGuid().ToString());
            _members = new List<Member>();
            _friends = new List<Friend>();

            using (var uow = new UnitOfWork())
            {
                uow.MemberRepository.Add(_member);

                var count = new Random().Next(2, 5);
                for (var i = 0; i < count; i++)
                {
                    var member = _memberFactory.CreateMember(Guid.NewGuid().ToString());
                    var friend = _friendFactory.CreateFriend(_member, member);
                    _friends.Add(friend);
                    _members.Add(member);

                    uow.MemberRepository.Add(member);
                    uow.FriendRepository.Add(friend);
                }

                uow.PersistAll();
            }

            using (var uow = new UnitOfWork())
            {
                var member = uow.MemberRepository.Get(_member.Id);
                _loadedFriends = uow.FriendRepository.GetFor(member);
            }
        }
        public static void SetUp(TestContext context)
        {
            _memberFactory = new MemberFactory();
            _friendFactory = new FriendFactory();

            _member1 = _memberFactory.CreateMember(Guid.NewGuid().ToString());
            _member2 = _memberFactory.CreateMember(Guid.NewGuid().ToString());

            _friend = _friendFactory.CreateFriend(_member1, _member2);

            using (var uow = new UnitOfWork())
            {
                _oldCount = uow.FriendRepository.Count();
                uow.MemberRepository.Add(_member1);
                uow.MemberRepository.Add(_member2);
                uow.FriendRepository.Add(_friend);
                uow.PersistAll();
            }

            using (var uow = new UnitOfWork())
            {
                _newCount = uow.FriendRepository.Count();
                _loadedFriend = uow.FriendRepository.Get(_friend.Id);
            }
        }
Exemple #3
0
        public FriendsViewModel(
            IFriendService friendService,
            IInviteService inviteService,
            IFriendFactory friendFactory,
            INavigationContext bottomBarDataItems,
            IStateService stateService)
        {
            _friendFactory = friendFactory;
            _friendService = friendService;
            _stateService  = stateService;

            IsNestedPullToRefreshEnabled = true;
        }
 public static void SetUp(TestContext context)
 {
     _unitOfWork = new UnitOfWork();
     _repository = _unitOfWork.FriendRepository;
     _factory = new FriendFactory();
 }