示例#1
0
        public void AddLoggingCommand_Should_LogSuccessfuly()
        {
            // Arrange
            var model   = new LoggingBlockModel("TestBlock", "Some message", LoggingBlockType.Error);
            var command = new AddLoggingCommand(model);

            // Act
            command.Run();

            // Assert
            Assert.True(command.SuccessfulOperation);
        }
        public LoggingBlockModel AddLog(string origin, string message, LoggingBlockType type)
        {
            var model = new LoggingBlockModel(origin, message, type);

            if (!model.IsValid())
            {
                return(model);
            }

            var command = new AddLoggingCommand(model);

            command.Run();
            return(model);
        }