示例#1
0
        public SaleItem(Product product, Unit unit)
        {
            Product = product;
            Unit = unit;

            AddRule(new SimpleRule("Price", "The Price can not be negative.", () => Price < 0m));
            AddRule(new SimpleRule("BasicDutyType", "The BasicDutyType should not be null!", () => BasicDutyType == null));
        }
示例#2
0
 public void Unit_Should_Be_One_Of_The_Units_Of_Product()
 {
     var product = new Product("book A");
     product.AddUnit(new Unit("bag"));
 }
示例#3
0
 public SaleItem(Product product)
     : this(product, product.Units[0])
 {
 }
示例#4
0
 public void SetUp()
 {
     _stubProduct = new Product("book");
 }