public void ParseColumns_EmptyList_ReturnsEmptyDict()
        {
            var parser = new ColumnPairParser();

            var result = parser.ParseColumns(new List<string>());

            Assert.IsFalse(result.Any());
        }
        public void ParseColumns_OneColumnWithTwoSeparators_ThrowsArgumentException()
        {
            var parser = new ColumnPairParser();

            Assert.Throws<ArgumentException>(
                () =>
                    parser.ParseColumns(new List<string> { "columnName:Value:andValue" })
            );
        }
        public void ParseColumns_OneColumnPairInValidFormat_ReturnsParsedPairInDict()
        {
            var parser = new ColumnPairParser();

            var result = parser.ParseColumns(new List<string>{"columnName:value"});

            Assert.IsTrue(result.ContainsKey("columnName"));
            Assert.AreEqual(result["columnName"], "value");
        }
        public void ParseColumns_TwoSetsOfColumns_ReturnsDictWithTwoKeysAndValues()
        {
            var parser = new ColumnPairParser();

            var result = parser.ParseColumns(new List<string>
                                                 {
                                                     "columnName:value",
                                                     "anotherColumn:anotherValue"
                                                 });

            Assert.IsTrue(result.ContainsKey("columnName"));
            Assert.AreEqual(result["columnName"], "value");

            Assert.IsTrue(result.ContainsKey("anotherColumn"));
            Assert.AreEqual(result["anotherColumn"], "anotherValue");
        }
 private IDictionary<string, string> ParseColumnData(UpdateKeyCommandOptions options)
 {
     var columnPariParser = new ColumnPairParser();
     return columnPariParser.ParseColumns(options.ColumnValues);
 }
 private static IDictionary<string, string> GetColumnCriteria(FindByColumnsCommandOptions findOptions)
 {
     var columnPairParser = new ColumnPairParser();
     return columnPairParser.ParseColumns(findOptions.ColumnCriteria);
 }