public CustomerBuilder WithTestValues()
        {
            _id             = VALID_CUSTOMER_ID;
            _firstName      = VALID_FIRST_NAME;
            _lastName       = VALID_LAST_NAME;
            _creditRating   = VALID_CREDIT_RATING;
            _totalPurchases = VALID_TOTAL_PURCHASES;

            var addressBuilder = new  AddressBuilder();

            _homeAddress = addressBuilder.WithTestValues().Build();

            return(this);
        }
Пример #2
0
        public CustomerBuilder WithTestValues()
        {
            _id             = TEST_ID;
            _firstName      = "FirstTest";
            _lastName       = "LastTest";
            _creditRating   = 250;
            _totalPurchases = 25;

            AddressBuilder addressBuilder = new AddressBuilder();

            _address = addressBuilder
                       .WithTestValues()
                       .Build();

            return(this);
        }
Пример #3
0
        public OrderBuilder WithTestValues()
        {
            _order.TotalAmount = 100m;
            var addressBuilder  = new AddressBuilder();
            var customerBuilder = new CustomerBuilder();

            var addressDirector  = new Director.Director(addressBuilder);
            var customerDirector = new Director.Director(customerBuilder);

            customerDirector.MakeCustomer();
            addressDirector.MakeAddress();


            _order.Customer             = customerBuilder.GetProduct();
            _order.Customer.HomeAddress = addressBuilder.GetProduct();

            return(this);
        }
Пример #4
0
 public CustomerBuilder BuildAddress(Func <AddressBuilder, AddressBuilder> addressBuild)
 {
     _addressBuilder = addressBuild(_addressBuilder);
     _internalCustomer.HomeAddress = _addressBuilder.Build();
     return(this);
 }