public void FindCountriesInPageMaterializeResults()
        {
            //Arrange
            var customerRepository = new SICustomerRepository();
            var countryRepository  = new SICountryRepository();

            countryRepository.GetPagedInt32Int32ExpressionOfFuncOfCountryKPropertyBoolean <string>((index, count, order, ascending) =>
            {
                var country = new Country("country name", "country iso");
                country.GenerateNewIdentity();

                return(new List <Country>()
                {
                    country
                });
            });

            var customerManagementService = new CustomerAppService(countryRepository, customerRepository);

            //Act
            var result = customerManagementService.FindCountries(0, 1);

            //Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count == 1);
        }
        public void FindCountriesInPageReturnNullIfNotData()
        {
            //Arrange
            var customerRepository = new SICustomerRepository();
            var countryRepository  = new SICountryRepository();

            countryRepository.GetPagedInt32Int32ExpressionOfFuncOfCountryKPropertyBoolean <string>((index, count, order, ascending) =>
            {
                return(new List <Country>());
            });

            var customerManagementService = new CustomerAppService(countryRepository, customerRepository);

            //Act
            var result = customerManagementService.FindCountries(0, 1);

            //Assert
            Assert.IsNull(result);
        }
        public void FindCountriesInPageMaterializeResults()
        {
            //Arrange
            var customerRepository = new SICustomerRepository();
            var countryRepository = new SICountryRepository();
            countryRepository.GetPagedInt32Int32ExpressionOfFuncOfCountryKPropertyBoolean<string>((index, count, order, ascending) =>
            {
                var country = new Country("country name", "country iso");
                country.GenerateNewIdentity();

                return new List<Country>()
                {
                    country
                };
            });

            var customerManagementService = new CustomerAppService(countryRepository, customerRepository);

            //Act
            var result = customerManagementService.FindCountries(0, 1);

            //Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count == 1);
        }
        public void FindCountriesInPageReturnNullIfNotData()
        {
            //Arrange
            var customerRepository = new SICustomerRepository();
            var countryRepository = new SICountryRepository();
            countryRepository.GetPagedInt32Int32ExpressionOfFuncOfCountryKPropertyBoolean<string>((index, count, order, ascending) =>
            {
                return new List<Country>();
            });

            var customerManagementService = new CustomerAppService(countryRepository, customerRepository);

            //Act
            var result = customerManagementService.FindCountries(0, 1);

            //Assert
            Assert.IsNull(result);
        }
        public void FindCountriesInPageMaterializeResults()
        {
            //Arrange
            var adapter = PrepareTypeAdapter();
            var customerRepository = new SICustomerRepository();
            var countryRepository = new SICountryRepository();
            countryRepository.GetPagedInt32Int32ExpressionOfFuncOfCountryKPropertyBoolean<string>((index, count, order, ascending) =>
            {
                return new List<Country>()
                {
                    new Country(){Id = Guid.NewGuid(),CountryName ="country name",CountryISOCode="country iso"}
                };
            });

            var customerManagementService = new CustomerAppService(adapter, countryRepository, customerRepository);

            //Act
            var result = customerManagementService.FindCountries(0, 1);

            //Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count == 1);
        }