public void GetAllAddressesByUserWithDataShouldReturnCorrectResults()
        {
            var addressRepository = new Mock <IRepository <Address> >();
            var userRepository    = new Mock <IRepository <ApplicationUser> >();
            var userStoreMock     = new Mock <IUserStore <ApplicationUser> >();
            var userManager       = new Mock <UserManager <ApplicationUser> >(userStoreMock.Object, null, null, null, null, null, null, null, null);

            userRepository.Setup(r => r.All()).Returns(this.DummyDataForUser().AsQueryable());
            var user = userRepository.Object.All().SingleOrDefault(x => x.FirstName == "root");

            addressRepository.Setup(r => r.All()).Returns(this.DummyDataAddresses(user.Id).AsQueryable());

            var service         = new ApplicationUserService(userRepository.Object, addressRepository.Object, userManager.Object);
            var actualResults   = service.GetAllAddresses <AddressViewModel>(user.Id).ToList();
            var expectedResults = this.DummyDataAddresses(user.Id).ToList();

            for (int i = 0; i < expectedResults.Count; i++)
            {
                var expectedEntry = expectedResults[i];
                var actualEntry   = actualResults[i];

                Assert.True(expectedEntry.City == actualEntry.City, "City does not match");
                Assert.True(expectedEntry.Description == actualEntry.Description, "Description does not match");
                Assert.True(expectedEntry.CityCode == actualEntry.CityCode, "CityCode does not match");
                Assert.True(expectedEntry.StreetAddress == actualEntry.StreetAddress, "StreetAddress does not match");
            }
        }
        public void GetAllAddressesByUserWithOutDataShouldReturnEmptyCollection()
        {
            var addressRepository = new Mock <IRepository <Address> >();
            var userRepository    = new Mock <IRepository <ApplicationUser> >();
            var userStoreMock     = new Mock <IUserStore <ApplicationUser> >();
            var userManager       = new Mock <UserManager <ApplicationUser> >(userStoreMock.Object, null, null, null, null, null, null, null, null);
            var service           = new ApplicationUserService(userRepository.Object, addressRepository.Object, userManager.Object);

            var actualAddresses = service.GetAllAddresses <AddressViewModel>("1").ToList();

            Assert.True(actualAddresses.Count == 0, "Get All Addresses does not return empty collection without data.");
        }