public void TestAddAndRemoveHomes()
        {
            Guid nhid = new Guid("6B696DBE-616C-4421-9011-D080354977B6");
            var context = new ControllerContext();
            context.RouteData.Values.Add("nhid", nhid.ToString());

            var controller = new HomeController();
            controller.ControllerContext = context;

            var result = controller.AddHome("newAddress", 70, -30);
            ViewResult listAction;
            IEnumerable<Home> listOfHomes = null;
            try
            {
                Assert.AreEqual("Homes", ((RedirectToRouteResult)result).RouteValues["action"].ToString());

                listAction = controller.Homes();

                listOfHomes = (IEnumerable<Home>) controller.ViewData.Model;

                Assert.IsTrue(listOfHomes.Any(h => h.AddressFull == "newAddress"));
            } finally
            {

                //Guid homeId;
                if (listOfHomes != null)
                {
                    Guid homeId = listOfHomes.Single(h => h.AddressFull == "newAddress").Id;
                    controller.RemoveHome(homeId);
                    listAction = controller.Homes();
                    listOfHomes = (IEnumerable<Home>)controller.ViewData.Model;
                    Assert.IsFalse(listOfHomes.Any(h => h.AddressFull == "newAddress"));

                    bool isThere = false;
                    try
                    {
                        var home = new HOAHome.Repositories.HomeRepository().Get(homeId);
                        isThere = true;
                    }catch
                    {
                    }
                    Assert.IsFalse(isThere,"Home did not get deleted");
                }

            }
        }
        public void ListHomeTest()
        {
            var factory = new FakeRepositoryFactory();
            var controller = new HomeController(factory);
            Guid nhid = Guid.NewGuid();
            var context = new ControllerContext();
            context.RouteData.Values.Add("nhid", nhid.ToString());
            controller.ControllerContext = context;

            factory.MockNeighborhoodRepository.Setup(n => n.GetHomes(nhid)).Returns(TestHomes.ToList());

            var result = controller.Homes();

            factory.MockHomeRepository.VerifyAll();

            // Assert.AreEqual("Homes", result.ViewName);
            Assert.AreEqual(TestHomes.First().AddressFull, ((IList<Home>)result.ViewData.Model).First().AddressFull);
        }