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 TodoItemReviewerRule(); 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 ProcessRuleAsyncPass(int priority, string expectedReviewer) { var request = CreateRequest(); request.Item.Priority = priority; var response = CreateResponse(); var rule = new TodoItemReviewerRule(); await rule.ProcessAsync(request, response, CreateBaseRulesWithRequiredRules()); Assert.AreEqual(expectedReviewer, response.Item.Reviewer); Assert.AreEqual(RuleStatusType.Passed, 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 TodoItemReviewerRule(); await rule.ProcessAsync(request, response, CreateBaseRulesWithRequiredRules()); Assert.AreEqual(null, response.Item.Reviewer); Assert.IsInstanceOfType(rule, typeof(BaseRule <Request <TodoItem>, Response <TodoItemEntity> >)); Assert.AreEqual(RuleStatusType.Failed, rule.Status); Assert.IsTrue(rule.ContinueProcessing); VerifyNotification.AssertResponseNotifications(CreateExpectedResponse(priority), response); }