public void Sort_ShouldSortContent()
        {
            // Arrange
            var obj = new MessageLines
            {
                { "-x", "any-text" },
                { "--a", "any-other-text" },
                { "d", "any-other-text-374573" },
                { "---c", "any-other-text-2" },
            };

            // Act
            obj.Sort();

            // Assert
            Assert.AreEqual(4, obj.Count());
            Assert.AreEqual("--a", obj.ElementAt(0).Key);
            Assert.AreEqual("any-other-text", obj.ElementAt(0).Value);
            Assert.AreEqual("---c", obj.ElementAt(1).Key);
            Assert.AreEqual("any-other-text-2", obj.ElementAt(1).Value);
            Assert.AreEqual("d", obj.ElementAt(2).Key);
            Assert.AreEqual("any-other-text-374573", obj.ElementAt(2).Value);
            Assert.AreEqual("-x", obj.ElementAt(3).Key);
            Assert.AreEqual("any-text", obj.ElementAt(3).Value);
        }
        public void ShouldTestAdd_OK()
        {
            // Arrange
            var msgKey   = "key";
            var msgValue = "value";

            var messageLine    = new MessageLines();
            var countBeforeAdd = messageLine.Count();

            // Act
            messageLine.Add(msgKey, msgValue);
            var countAfterAdd = messageLine.Count();

            // Assert
            Assert.IsNotNull(messageLine);
            Assert.AreEqual(0, countBeforeAdd);
            Assert.AreEqual(1, countAfterAdd);
            Assert.IsTrue(messageLine.All(v => v.Key.Contains(msgKey)));
            Assert.IsTrue(messageLine.All(v => v.Value.Contains(msgValue)));
        }
        public void ShouldTestCopyConstructor_OK()
        {
            // Arrange
            var msgKey            = "key";
            var msgValue          = "value";
            var messageLineToCopy = new MessageLines {
                { msgKey, msgValue }
            };

            // Act
            var messageLine = new MessageLines(messageLineToCopy);

            // Assert
            Assert.IsNotNull(messageLine);
            Assert.AreEqual(1, messageLine.Count());
            Assert.IsTrue(messageLine.All(v => v.Key.Contains(msgKey)));
            Assert.IsTrue(messageLine.All(v => v.Value.Contains(msgValue)));
        }
        public void HelpData_Clone_ShouldPerformDeepClone()
        {
            // Arrange
            const string commandName       = "any-name";
            var          helpTextFirstLine = new MessageLines {
                { "any-header-begin", "any-message-begin" }
            };
            var helpTextLastLine = new MessageLines {
                { "any-header-end", "any-message-end" }
            };
            const string helpText   = "any-help-text";
            const string logMessage = "any-log-message";

            var obj = new HelpData
            {
                CommandName       = commandName,
                HelpTextFirstLine = helpTextFirstLine,
                HelpTextLastLine  = helpTextLastLine,
                HelpText          = helpText,
                LogMessage        = logMessage,
            };

            // Act
            var clone = obj.Clone();

            // Assert
            Assert.AreEqual(commandName, clone.CommandName);
            Assert.AreNotSame(helpTextFirstLine, clone.HelpTextFirstLine);
            Assert.AreEqual(1, helpTextFirstLine.Count());
            Assert.AreEqual(1, clone.HelpTextFirstLine.Count());
            Assert.AreEqual(1, helpTextLastLine.Count());
            Assert.AreEqual(1, clone.HelpTextLastLine.Count());
            Assert.AreEqual(helpTextFirstLine.First().Key, clone.HelpTextFirstLine.First().Key);
            Assert.AreEqual(helpTextFirstLine.First().Value, clone.HelpTextFirstLine.First().Value);
            Assert.AreEqual(helpTextLastLine.First().Key, clone.HelpTextLastLine.First().Key);
            Assert.AreEqual(helpTextLastLine.First().Value, clone.HelpTextLastLine.First().Value);
            Assert.AreNotSame(helpTextLastLine, clone.HelpTextLastLine);
            Assert.AreEqual(helpText, clone.HelpText);
            Assert.AreEqual(logMessage, clone.LogMessage);
        }