public void AutoXact_PostPred_Checks_O_EQ() { ExprOp op = new ExprOp(OpKindEnum.O_EQ) { Left = new ExprOp(OpKindEnum.VALUE) { AsValue = Value.Get(true) }, Right = new ExprOp(OpKindEnum.VALUE) { AsValue = Value.Get(true) }, }; Assert.True(AutoXact.PostPred(op, null)); ExprOp op1 = new ExprOp(OpKindEnum.O_EQ) { Left = new ExprOp(OpKindEnum.VALUE) { AsValue = Value.Get(false) }, Right = new ExprOp(OpKindEnum.VALUE) { AsValue = Value.Get(true) }, }; Assert.False(AutoXact.PostPred(op1, null)); }
public void AutoXact_PostPred_Checks_O_MATCH() { ExprOp op = new ExprOp(OpKindEnum.O_MATCH) { Left = new ExprOp(OpKindEnum.IDENT) { AsIdent = "account" }, Right = new ExprOp(OpKindEnum.VALUE) { AsValue = Value.Get(new Mask("acc-name")) } }; Post post = new Post() { ReportedAccount = new Account(null, "acc-name") }; Assert.True(AutoXact.PostPred(op, post)); Post post1 = new Post() { ReportedAccount = new Account(null, "dummy") }; Assert.False(AutoXact.PostPred(op, post1)); }
public void AutoXact_Description_ReturnsPosOrStaticText() { AutoXact autoXact = new AutoXact(); Assert.Equal(AutoXact.GeneratedAutomatedTransactionKey, autoXact.Description); autoXact.Pos = new ItemPosition() { BegLine = 22 }; Assert.Equal("automated transaction at line 22", autoXact.Description); }
public void AutoXact_PostPred_Checks_VALUE() { ExprOp op = new ExprOp(OpKindEnum.VALUE) { AsValue = Value.Get(true) }; Assert.IsTrue(AutoXact.PostPred(op, null)); ExprOp op1 = new ExprOp(OpKindEnum.VALUE) { AsValue = Value.Get(false) }; Assert.IsFalse(AutoXact.PostPred(op1, null)); }