public static OperationResult AsDone(AppliedOperation appliedOperation, string comment = null) { return(new OperationResult { Status = OperationStatus.Done, Result = appliedOperation, Comment = comment }); }
bool IEquatable <OperationResult> .Equals(OperationResult other) { if (other == null) { return(false); } return(this.Status.Equals(other.Status) && string.Equals(this.Comment, other.Comment) && AppliedOperation.Equals(this.Result, other.Result)); }
public OperationResult ApplyOn(Account account) { if (!IsValidFor(account)) { return(OperationResult.AsRejected("rejected")); } var appliedOperation = new AppliedOperation( this, account.CurrentBalance, account.CurrentBalance - Amount, DateTime.Now ); return(OperationResult.AsDone(appliedOperation)); }