Exemple #1
0
        public void async_command_handler_test()
        {
            var command = new AsyncHandlerCommand()
            {
                AggregateRootId = ObjectId.GenerateNewStringId()
            };
            var asyncResult = _commandService.ExecuteAsync(command).Result;

            Assert.IsNotNull(asyncResult);
            Assert.AreEqual(AsyncTaskStatus.Success, asyncResult.Status);
            var commandResult = asyncResult.Data;

            Assert.IsNotNull(commandResult);
            Assert.AreEqual(CommandStatus.Success, commandResult.Status);
        }
Exemple #2
0
        public void duplicate_async_command_with_application_message_test()
        {
            var command = new AsyncHandlerCommand()
            {
                AggregateRootId = ObjectId.GenerateNewStringId(),
                ShouldGenerateApplicationMessage = true
            };
            var asyncResult = _commandService.ExecuteAsync(command).Result;

            Assert.IsNotNull(asyncResult);
            Assert.AreEqual(AsyncTaskStatus.Success, asyncResult.Status);
            var commandResult = asyncResult.Data;

            Assert.IsNotNull(commandResult);
            Assert.AreEqual(CommandStatus.Success, commandResult.Status);

            asyncResult = _commandService.ExecuteAsync(command).Result;
            Assert.IsNotNull(asyncResult);
            Assert.AreEqual(AsyncTaskStatus.Success, asyncResult.Status);
            commandResult = asyncResult.Data;
            Assert.IsNotNull(commandResult);
            Assert.AreEqual(CommandStatus.Success, commandResult.Status);
        }
Exemple #3
0
        public void duplicate_async_command_with_application_message_test()
        {
            var command = new AsyncHandlerCommand()
            {
                AggregateRootId = ObjectId.GenerateNewStringId(),
                ShouldGenerateApplicationMessage = true
            };
            var asyncResult = _commandService.ExecuteAsync(command).Result;
            Assert.IsNotNull(asyncResult);
            Assert.AreEqual(AsyncTaskStatus.Success, asyncResult.Status);
            var commandResult = asyncResult.Data;
            Assert.IsNotNull(commandResult);
            Assert.AreEqual(CommandStatus.Success, commandResult.Status);

            asyncResult = _commandService.ExecuteAsync(command).Result;
            Assert.IsNotNull(asyncResult);
            Assert.AreEqual(AsyncTaskStatus.Success, asyncResult.Status);
            commandResult = asyncResult.Data;
            Assert.IsNotNull(commandResult);
            Assert.AreEqual(CommandStatus.Success, commandResult.Status);
        }
Exemple #4
0
 public void async_command_handler_test()
 {
     var command = new AsyncHandlerCommand()
     {
         AggregateRootId = ObjectId.GenerateNewStringId()
     };
     var asyncResult = _commandService.ExecuteAsync(command).Result;
     Assert.IsNotNull(asyncResult);
     Assert.AreEqual(AsyncTaskStatus.Success, asyncResult.Status);
     var commandResult = asyncResult.Data;
     Assert.IsNotNull(commandResult);
     Assert.AreEqual(CommandStatus.Success, commandResult.Status);
 }