public void ToStringTest(string input, string output) { var rule = new AmountRule(); rule.FromString(input); Assert.AreEqual(output, rule.ToString()); }
public void IsMatchTest(string ruleDef, decimal value, bool expectedResult) { var rule = new AmountRule(); rule.FromString(ruleDef); Assert.AreEqual(expectedResult, rule.IsMatch(value)); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } AmountRule = await _context.AmountRule.FirstOrDefaultAsync(m => m.AmountRuleID == id); if (AmountRule == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } AmountRule = await _context.AmountRule.FindAsync(id); if (AmountRule != null) { _context.AmountRule.Remove(AmountRule); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public ProcessingRuleVm() { mAmountRule = new AmountRule(); }
public void IsValidTest(string input, bool expectedResult) { var rule = new AmountRule(); Assert.AreEqual(expectedResult, rule.FromString(input)); }