示例#1
0
        public async Task ProcessRuleAsyncPass()
        {
            var request  = CreateRequest();
            var response = CreateResponse();

            var rule = new RequestRule();
            await rule.ProcessAsync(request, response, RuleFactory.CreateEmptyListOfSaveRules());

            Assert.AreEqual(RuleStatusType.Passed, rule.Status);
            Assert.IsTrue(rule.ContinueProcessing);

            Assert.AreEqual(0, response.Notifications.Count);
        }
示例#2
0
        public async Task ProcessRuleAsyncNotProvided()
        {
            var request  = CreateRequestWithNoItem();
            var response = CreateResponse();

            var rule = new RequestRule();
            await rule.ProcessAsync(request, response, RuleFactory.CreateEmptyListOfSaveRules());

            Assert.IsInstanceOfType(rule, typeof(BaseRule <Request <TodoItem>, Response <TodoItemEntity> >));
            Assert.AreEqual(RuleStatusType.Failed, rule.Status);
            Assert.IsFalse(rule.ContinueProcessing);

            VerifyNotification.AssertResponseNotifications(CreateExpectedResponse(), response);
        }