Пример #1
0
        public async Task Should_return_succeeded_job_with_full_dump_when_handler_returns_no_exception()
        {
            A.CallTo(() => ruleActionHandler.ExecuteJobAsync(A <ValidData> .That.Matches(x => x.Value == 10)))
            .Returns((actionDump, null));

            var result = await sut.InvokeAsync(actionName, actionData);

            Assert.Equal(RuleResult.Success, result.Result);

            Assert.True(result.Elapsed >= TimeSpan.Zero);
            Assert.StartsWith(actionDump, result.Dump, StringComparison.OrdinalIgnoreCase);
        }
Пример #2
0
        public async Task Should_return_succeeded_job_with_full_dump_when_handler_returns_no_exception()
        {
            var ruleJob = new JObject();

            var actionDump = "MyDump";

            A.CallTo(() => ruleActionHandler.ExecuteJobAsync(ruleJob))
            .Returns((actionDump, null));

            var result = await sut.InvokeAsync("ValidAction", ruleJob);

            Assert.Equal(RuleResult.Success, result.Result);

            Assert.True(result.Elapsed >= TimeSpan.Zero);
            Assert.StartsWith(actionDump, result.Dump, StringComparison.OrdinalIgnoreCase);
        }