public void FindCustomerMaterializaResultIfExist()
      {
         //Arrange
         var countryRepository = new StubICountryRepository();
         var customerRepository = new StubICustomerRepository();
         var country = new Country("spain", "es-ES");
         country.GenerateNewIdentity();

         customerRepository.GetGuid =
            (guid) =>
            {
               return CustomerFactory.CreateCustomer(
                  "Jhon",
                  "El rojo",
                  "+3434344",
                  "company",
                  country,
                  new Address("city", "zipCode", "address line1", "address line2"));
            };

         var customerManagementService = new CustomerAppService(countryRepository, customerRepository);

         //Act
         var result = customerManagementService.FindCustomer(Guid.NewGuid());

         //Assert
         Assert.IsNotNull(result);
      }
        public void FindCustomerReturnNullIfCustomerIdIsEmpty()
        {
            //Arrange
            var adapter = PrepareTypeAdapter();
            var countryRepository = new SICountryRepository();
            var customerRepository = new SICustomerRepository();

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

            //Act
            var result = customerManagementService.FindCustomer(Guid.Empty);

            //Assert
            Assert.IsNull(result);
        }
      public void FindCustomerReturnNullIfCustomerIdIsEmpty()
      {
         //Arrange
         var countryRepository = new StubICountryRepository();
         var customerRepository = new StubICustomerRepository();
         customerRepository.GetGuid = (guid) =>
         {
            if (guid == Guid.Empty) {
               return null;
            }
            else
            {
               return new Customer();
            }
         };
         var customerManagementService = new CustomerAppService(countryRepository, customerRepository);

         //Act
         var result = customerManagementService.FindCustomer(Guid.Empty);

         //Assert
         Assert.IsNull(result);

      }
        public void FindCustomerMaterializaResultIfExist()
        {
            //Arrange
            var adapter = PrepareTypeAdapter();
            var countryRepository = new SICountryRepository();
            var customerRepository = new SICustomerRepository();
            customerRepository.GetGuid = (guid) =>
            {
                return CustomerFactory.CreateCustomer("Jhon",
                                                      "El rojo",
                                                      Guid.NewGuid(),
                                                      new Address("city", "zipCode", "address line1", "address line2"));

            };

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

            //Act
            var result = customerManagementService.FindCustomer(Guid.NewGuid());

            //Assert
            Assert.IsNotNull(result);
        }