public async Task GetPropertiesByPortfolioIdAsyncReturnsCorrectProperties()
        {
            var portfolio1 = new Portfolio {
                Name = "Portfolio1"
            };
            var portfolio2 = new Portfolio {
                Name = "Portfolio2"
            };

            var properties = new List <Property> {
                new Property
                {
                    Address = new Address {
                        City            = "Exeter",
                        CreatedDateTime = DateTime.Now.AddDays(-3),
                        IsActive        = true,
                        Line1           = "Line 1",
                        Line2           = "Line 2",
                        PostCode        = "Postcode",
                        Town            = "Town"
                    },
                    Description     = "Description",
                    IsActive        = true,
                    NoOfBeds        = 2,
                    PropertyValue   = 12345,
                    PurchaseDate    = new DateTime(2008, 3, 1),
                    PurchasePrice   = 12343,
                    RentalPrice     = 431,
                    CreatedDateTime = DateTime.Now.AddDays(-1),
                    Portfolio       = portfolio1,
                    Tenants         = new List <Tenant> {
                        new Tenant {
                            FirstName = "FirstName1", LastName = "LastName1", EmailAddress = "*****@*****.**", IsActive = true, Profession = "Window cleaner", TenancyStartDate = DateTime.Now.AddDays(-1)
                        },
                        new Tenant {
                            FirstName = "FirstName2", LastName = "LastName2", EmailAddress = "*****@*****.**", IsActive = true, Profession = "Superstar DJ", TenancyStartDate = DateTime.Now.AddDays(-1)
                        }
                    }
                }, new Property
                {
                    Address = new Address {
                        City            = "Plymouth",
                        CreatedDateTime = DateTime.Now.AddDays(-3),
                        IsActive        = true,
                        Line1           = "Line 1",
                        Line2           = "Line 2",
                        PostCode        = "Postcode",
                        Town            = "Town"
                    },
                    Description     = "Description Two",
                    IsActive        = true,
                    NoOfBeds        = 2,
                    PropertyValue   = 76547,
                    PurchaseDate    = new DateTime(2008, 3, 1),
                    PurchasePrice   = 75273,
                    RentalPrice     = 654,
                    CreatedDateTime = DateTime.Now.AddDays(-1),
                    Portfolio       = portfolio1,
                    Tenants         = new List <Tenant> {
                        new Tenant {
                            FirstName = "FirstName3", LastName = "LastName3", EmailAddress = "*****@*****.**", IsActive = true, Profession = "Window cleaner", TenancyStartDate = DateTime.Now.AddDays(-1)
                        },
                    }
                },
                new Property
                {
                    Address = new Address {
                        City            = "Saltash",
                        CreatedDateTime = DateTime.Now.AddDays(-3),
                        IsActive        = true,
                        Line1           = "Line 1",
                        Line2           = "Line 2",
                        PostCode        = "Postcode",
                        Town            = "Town"
                    },
                    Description     = "Description Three",
                    IsActive        = true,
                    NoOfBeds        = 4,
                    PropertyValue   = 76547,
                    PurchaseDate    = new DateTime(2008, 3, 1),
                    PurchasePrice   = 75273,
                    RentalPrice     = 654,
                    CreatedDateTime = DateTime.Now.AddDays(-1),
                    Portfolio       = portfolio2,
                    Tenants         = new List <Tenant> {
                        new Tenant {
                            FirstName = "FirstName5", LastName = "LastName5", EmailAddress = "*****@*****.**", IsActive = true, Profession = "Window cleaner", TenancyStartDate = DateTime.Now.AddDays(-1)
                        },
                    }
                }
            };

            _propertyServiceMock.Setup(s => s.GetPropertiesForPortfolio(It.IsAny <Guid>()))
            .Returns(Task.FromResult <IList <Property> >(properties.Where(x => x.PortfolioId == portfolio1.Id).ToList())).Verifiable();

            var controller = new PropertiesController(_propertyServiceMock.Object, _mapperMock);

            controller.ControllerContext = new ControllerContext()
            {
                HttpContext = new DefaultHttpContext()
                {
                    User = _principle
                }
            };

            var results = await controller.GetPropertiesByPortfolioId(It.IsAny <Guid>());

            var okResult = results.Result as OkObjectResult;
            var okVal    = okResult.Value as IList <PropertyDetailDto>;

            Assert.AreEqual((int)System.Net.HttpStatusCode.OK, okResult.StatusCode);
            Assert.AreEqual(2, okVal.Count());
        }