Пример #1
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);
		}
Пример #2
0
		public ApplyCommands(Order order)
		{
			this.order = order;
		}