예제 #1
0
 public void op_Line_KeyStringDictionaryNull_IListOfString()
 {
     var columns = new List<string>
                       {
                           "A"
                       };
     Assert.Throws<ArgumentNullException>(() => Tsv.Line(null, columns));
 }
예제 #2
0
        public void op_Line_IEnumerableString_whenEmptyValue()
        {
            var obj = new List<string>
                          {
                              string.Empty,
                              "ABC"
                          };

            const string expected = "\tABC";
            var actual = Tsv.Line(obj);

            Assert.Equal(expected, actual);
        }
예제 #3
0
        public void op_Line_IEnumerableString()
        {
            var obj = new List<string>
                          {
                              "123",
                              "ABC"
                          };

            const string expected = "123\tABC";
            var actual = Tsv.Line(obj);

            Assert.Equal(expected, actual);
        }
예제 #4
0
        public void op_Line_KeyStringDictionary_whenEmptyValue()
        {
            var obj = new KeyStringDictionary
                          {
                              new KeyStringPair("A", string.Empty),
                              new KeyStringPair("B", "XYZ")
                          };

            const string expected = "\tXYZ";
            var actual = Tsv.Line(obj);

            Assert.Equal(expected, actual);
        }
예제 #5
0
        public void op_Line_KeyStringDictionary()
        {
            var obj = new KeyStringDictionary
                          {
                              new KeyStringPair("A", "123"),
                              new KeyStringPair("B", "XYZ")
                          };

            const string expected = "123\tXYZ";
            var actual = Tsv.Line(obj);

            Assert.Equal(expected, actual);
        }
예제 #6
0
        public void op_Line_KeyStringDictionary_IListOfString()
        {
            var obj = new KeyStringDictionary
                          {
                              new KeyStringPair("A", "123"),
                              new KeyStringPair("B", "ignore"),
                              new KeyStringPair("C", "XYZ")
                          };

            const string expected = "123\tXYZ";
            var actual = Tsv.Line(obj, "A|C".Split('|').ToList());

            Assert.Equal(expected, actual);
        }
예제 #7
0
 public void op_Line_IEnumerableStringNull()
 {
     Assert.Throws<ArgumentNullException>(() => Tsv.Line(null as IEnumerable<string>));
 }
예제 #8
0
 public void op_Line_IEnumerableStringEmpty()
 {
     Assert.Throws<ArgumentOutOfRangeException>(() => Tsv.Line(new List<string>()));
 }
예제 #9
0
 public void op_Line_KeyStringDictionary_IListOfString_whenColumnsNotFound()
 {
     Assert.Throws<KeyNotFoundException>(() => Tsv.Line(new KeyStringDictionary(), "A,B".Split(',').ToList()));
 }
예제 #10
0
 public void op_Line_KeyStringDictionary_IListOfStringNull()
 {
     Assert.Throws<ArgumentNullException>(() => Tsv.Line(new KeyStringDictionary(), null as IList<string>));
 }
예제 #11
0
 public void op_Line_KeyStringDictionary_IListOfStringEmpty()
 {
     Assert.Throws<ArgumentOutOfRangeException>(() => Tsv.Line(new KeyStringDictionary(), new List<string>()));
 }
예제 #12
0
 public void op_Line_KeyStringDictionaryNull()
 {
     Assert.Throws<ArgumentNullException>(() => Tsv.Line(null as KeyStringDictionary));
 }