public Charge(ChargeBuilder builder) { this.id = builder.id; this.clientAccount = builder.clientAccount; this.billableConcept = builder.billableConcept; this.amount = builder.amount; this.description = builder.description; this.value_date = builder.value_date; this.workflow_state = builder.workflow_state; this.last_change_user = builder.last_change_user; this.last_change_date = builder.last_change_date; }
/// <summary> /// Creem un càrrec en mèmoria /// </summary> public void TestBuildCharge() { Account accountToTest = new Account(); BillableConcept billableConceptToTest = new BillableConcept(); long userIdToTest = 789; Charge c = new ChargeBuilder(userIdToTest, DateTime.Now) .To(accountToTest) .From(billableConceptToTest) .WithDate(DateTime.Now) .With(new decimal(123.456)) .AddDescription("ChargeToTest") .WithWorkFlowState(666) .Build(); Assert.IsType <Charge>(c); }