I strive to create a system based on a clean domain design. As far as I know, this means that my domain objects should have behavior, but not form. That is, they should not have any getters or other accessories.
At the same time, I am trying to monitor TDD processes and have run into a stumbling block with the test I am trying to write.
[Test] public class new_purchase_order_should_have_purchase_ordernumber_of_1 { PurchaseOrder po = PurchaseOrder.CreatePurchaseOrder() Assert.AreEqual(1,po.PurchaseOrderNumber); } public class PurchaseOrder { private int _purchaseOrderNumber; static CreatePurchaseOrder() { _purchaseOrderNumber = SomeWayOfGettingAPONumber()
If getters are not allowed, how can I verify that the CreatePurchaseOrder () methods work correctly and sets the value to 1.
This is a big conceptual obstacle for me in trying to implement this design, so any advice would be really helpful.
thanks
source share