Esempio n. 1
0
        public OrderBuilder WithTestValues()
        {
            _order.TotalAmount = VALID_ORDER_AMOUNT;
            var customerBuilder = new CustomerBuilder();

            _order.Customer = customerBuilder.WithTestValues().Build();

            return(this);
        }
Esempio n. 2
0
        public OrderBuilder WithTestValues()
        {
            _order.TotalAmount = 100m;
            _order.Id          = 0;

            CustomerBuilder customerbuilder = new CustomerBuilder();

            _order.Customer = customerbuilder
                              .Id(10)
                              .WithTestValues()
                              .Build();

            return(this);
        }
Esempio n. 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);
        }
Esempio n. 4
0
 public OrderBuilder BuildCustomer(Func <CustomerBuilder, CustomerBuilder> customerBuild)
 {
     _customerBuilder = customerBuild(_customerBuilder);
     _order.Customer  = _customerBuilder.Build();
     return(this);
 }