Exemple #1
0
        public void When_He_Has_Credit_Limit_Then_Return_True()
        {
            _mockCustomer.HasCreditLimit = true;
            var result = CustomerUtils.IsLimtedCredit(_mockCustomer);

            Assert.AreEqual(true, result);
        }
Exemple #2
0
        public bool AddCustomer(Customer customerInfo)
        {
            if (!ValidateCustomInfo(customerInfo))
            {
                return(false);
            }

            var company = _companyRepository.GetById(customerInfo.CompanyId);

            var customer = InitCustomer(customerInfo, company);

            this.GetCustomerCredit(company, customer);

            if (CustomerUtils.IsLimtedCredit(customer))
            {
                return(false);
            }

            _customerDataAccess.AddCustomer(customer);

            return(true);
        }