public void ShouldReturnListOfMatchedRequestsForUserJourney()
        {
            var matchRepositoryMock = new Mock<IMatchRepository> {};
            var userRepositoryMock = new Mock<IUserRepository> { };
            List<Match> matchedRequests = new List<Match>();
            Match match = new Match(new Journey(),new Request());
            match.Status = MatchStatus.Potential;
            matchedRequests.Add(match);
            matchRepositoryMock.Setup(ps => ps.LoadPotentialMatchesByUserJourney("*****@*****.**")).Returns(matchedRequests);

            Website.Controllers.RequestMatchController requestMatchController =
                            new Website.Controllers.RequestMatchController(matchRepositoryMock.Object, userRepositoryMock.Object, "*****@*****.**");
            ActionResult result = requestMatchController.MatchRequest();
            Assert.AreEqual(((IList<Match>) requestMatchController.ViewData["MatchList"]).Count, 1);
            matchRepositoryMock.Verify(ps => ps.LoadPotentialMatchesByUserJourney("*****@*****.**"));
        }
        public void ShouldAcceptSelectedMatchedRequestsAndChangeStatusOfTheRequests()
        {
            var matchRepositoryMock = new Mock<IMatchRepository> { };
            var userRepositoryMock = new Mock<IUserRepository> {};

            List<Match> matchedRequests = new List<Match>();
            Request request = new Request();
            User user = new User();
            user.Email = new Email("*****@*****.**");

            Match match = new Match(new Journey(), request);
            match.Status = MatchStatus.Potential;
            match.Id = 1;
            matchedRequests.Add(match);
            matchRepositoryMock.Setup(ps => ps.LoadPotentialMatchesByUserJourney("*****@*****.**")).Returns(matchedRequests);
            userRepositoryMock.Setup(ps => ps.LoadUser("*****@*****.**")).Returns(user);

            Website.Controllers.RequestMatchController requestMatchController =
                            new Website.Controllers.RequestMatchController(matchRepositoryMock.Object,userRepositoryMock.Object ,"*****@*****.**");
            requestMatchController.AcceptRequest(new string[]{"1"});
            Assert.AreEqual(match.Status,MatchStatus.Accepted);
            Assert.AreEqual(match.Request.AcceptingUser,user);
            matchRepositoryMock.Verify(ps => ps.UpdateMatches(matchedRequests));
        }