public async Task ProcessRuleAsyncSkipped(string scenario, object expectedRules) { var rules = (List <IBaseRule <Request <TodoItem>, Response <TodoItemEntity> > >)expectedRules; var request = CreateRequest(); var response = CreateResponse(); var rule = new TodoItemPriorityRule(); await rule.ProcessAsync(request, response, rules); Assert.AreEqual(RuleStatusType.Skipped, rule.Status); Assert.IsTrue(rule.ContinueProcessing); Assert.AreEqual(0, response.Notifications.Count); }
public async Task ProcessRuleAsyncPriorityIsNotInRange(int priority) { var request = CreateRequest(); request.Item.Priority = priority; var response = CreateResponse(); var rule = new TodoItemPriorityRule(); await rule.ProcessAsync(request, response, CreateBaseRulesWithRequiredRules()); Assert.IsInstanceOfType(rule, typeof(BaseRule <Request <TodoItem>, Response <TodoItemEntity> >)); Assert.AreEqual(RuleStatusType.Failed, rule.Status); Assert.IsTrue(rule.ContinueProcessing); VerifyNotification.AssertResponseNotifications(CreateExpectedResponse(), response); }
public async Task ProcessRuleAsyncPass(int priority) { var request = CreateRequest(); request.Item.Priority = priority; var response = CreateResponse(); var rule = new TodoItemPriorityRule(); await rule.ProcessAsync(request, response, CreateBaseRulesWithRequiredRules()); Assert.AreEqual(priority, response.Item.Priority); Assert.AreEqual(RuleStatusType.Passed, rule.Status); Assert.IsTrue(rule.ContinueProcessing); Assert.AreEqual(0, response.Notifications.Count); }