Exemplo n.º 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));
        }
Exemplo n.º 2
0
 public void Unit_Should_Be_One_Of_The_Units_Of_Product()
 {
     var product = new Product("book A");
     product.AddUnit(new Unit("bag"));
 }
Exemplo n.º 3
0
 public SaleItem(Product product)
     : this(product, product.Units[0])
 {
 }
Exemplo n.º 4
0
 public void SetUp()
 {
     _stubProduct = new Product("book");
 }