コード例 #1
0
        public async Task ShouldLogInfoWhenExecutingACommand()
        {
            var args = new FakeCommandArgs();
            await _bus.ExecuteAsync(args);

            Assert.True(args.DidExecute);
            Assert.Equal(2, _logger.GetMessages(LogLevel.Information).Length);
        }
コード例 #2
0
        public async Task ShouldUseRetryAndLoggingQueryDecorators()
        {
            var args = new FakeRetryQueryArgs(2, new int[0]);
            await _bus.ExecuteAsync <FakeRetryQueryArgs, int[]>(args);

            Assert.Equal(3, args.TimesExecuted);
            Assert.Equal(4, _logger.GetMessages(LogLevel.Information).Length);
        }
コード例 #3
0
        public async Task ShouldRetryQueryThreeTimes()
        {
            var args = new FakeRetryQueryArgs(2, new [] { 4, 3 });

            var result = await _bus.ExecuteAsync <FakeRetryQueryArgs, int[]>(args);

            Assert.Equal(args.Result, result);
            Assert.Equal(3, args.TimesExecuted);
        }
コード例 #4
0
        public async Task ShouldExecuteCommand()
        {
            var args = new FakeCommandArgs();
            await _bus.ExecuteAsync(args);

            Assert.True(args.DidExecute);
        }
コード例 #5
0
        public async Task <ActionResult> List()
        {
            var leagues = await _bus.ExecuteAsync <GetAllLeaguesQueryArgs, League[]>(new GetAllLeaguesQueryArgs());

            return(View("List", leagues));
        }