public void DetailShoudThrowHttpExceptionWhenHomeIdDoesNotExist()
        {
            var userServerce = new Mock<IUsersService>();
            var homeService = new Mock<IHomeService>();
            var giftService = new Mock<IGiftService>();

            homeService.Setup(x => x.GetHomeById(It.IsAny<int>()))
                .Returns(new List<Home>().AsQueryable());

            var controller = new InstitutionController(userServerce.Object, homeService.Object, giftService.Object);
            controller.WithCallTo(x => x.Details(It.IsAny<int>()))
                .ShouldRenderView("Details");
        }
        public void HomeDetailsShoudWorkCorrectlyWithCorrenctIdParameter()
        {
            var userServerce = new Mock<IUsersService>();
            var homeService = new Mock<IHomeService>();
            var giftService = new Mock<IGiftService>();

            homeService.Setup(x => x.GetHomeById(1))
                .Returns(new List<Home>() {new Home()
                {
                    Id = 1,
                    Location = new Location(),
                    HomeAdministrator = new User(),
                    Children = new List<Child>()
                } }.AsQueryable());

            var controller = new InstitutionController(userServerce.Object, homeService.Object, giftService.Object);
            controller.WithCallTo(x => x.Details(1))
                .ShouldRenderView("Details");
        }
        public void HomeDetailsShoudMapViewModelCorrectly()
        {
            var userServerce = new Mock<IUsersService>();
            var homeService = new Mock<IHomeService>();
            var giftService = new Mock<IGiftService>();

            homeService.Setup(x => x.GetHomeById(1))
                .Returns(new List<Home>() {new Home()
                {
                    Id = 1,
                    Name = "THEHOME",
                    Location = new Location(),
                    HomeAdministrator = new User(),
                    Children = new List<Child>()
                } }.AsQueryable());

            var controller = new InstitutionController(userServerce.Object, homeService.Object, giftService.Object);
            controller.WithCallTo(x => x.Details(1))
                .ShouldRenderView("Details")
                .WithModel<DetailsInstitutionViewModel>(viewModel =>
                {
                    Assert.AreEqual(viewModel.Name, "THEHOME");
                });
        }