public void CanExecuteWhenStatement()
		{
			ExternalDSLDemo dsl = new ExternalDSLDemo(sentence);
			dsl.AddParameter("customer", new Customer());
			dsl.AddParameter("order", new Order());
			dsl.Execute();
		}
Example #2
0
        public void CanExecuteWhenStatement()
        {
            ExternalDSLDemo dsl = new ExternalDSLDemo(sentence);

            dsl.AddParameter("customer", new Customer());
            dsl.AddParameter("order", new Order());
            dsl.Execute();
        }
		public void CanExecuteThenStatement()
		{
			ExternalDSLDemo dsl = new ExternalDSLDemo(sentence);
			Customer customer = new Customer();
			customer.CustomerStatus = CustomerStatus.Preferred;
			dsl.AddParameter("customer", customer);
			Order order = new Order();
			order.TotalCost = 5000;
			order.ShippingType = ShippingType.Fast;
			dsl.AddParameter("order", order);
			dsl.AddParameter("apply", new ApplyCommands(order));
			dsl.Execute();

			Assert.Equal(4750, order.TotalCost);
			Assert.Equal(ShippingType.Free, order.ShippingType);
		}
Example #4
0
        public void CanExecuteThenStatement()
        {
            ExternalDSLDemo dsl      = new ExternalDSLDemo(sentence);
            Customer        customer = new Customer();

            customer.CustomerStatus = CustomerStatus.Preferred;
            dsl.AddParameter("customer", customer);
            Order order = new Order();

            order.TotalCost    = 5000;
            order.ShippingType = ShippingType.Fast;
            dsl.AddParameter("order", order);
            dsl.AddParameter("apply", new ApplyCommands(order));
            dsl.Execute();

            Assert.Equal(4750, order.TotalCost);
            Assert.Equal(ShippingType.Free, order.ShippingType);
        }