Пример #1
0
        public void Fields_Count_not_equal_Values_Count()
        {
            var target = new ConvertCsvToNewInstance();

            target.ClassName = "A";
            target.InputEachLine("F1,F2");
            target.InputEachLine("\"f1\",\"f2\"");
            target.InputEachLine("\"f1\",\"f2\",f3");
            var actual = target.Result;
        }
Пример #2
0
        public void InputEachLine_No_Value()
        {
            var target = new ConvertCsvToNewInstance();

            target.ClassName = "A";
            target.InputEachLine("F1,F2");
            var actual = target.Result;

            var expected = "";

            expected.ToExpectedObject().ShouldEqual(actual);
        }
Пример #3
0
        public void InputEachLine_Value_2_line()
        {
            var target = new ConvertCsvToNewInstance();

            target.ClassName = "A";
            target.InputEachLine("F1,F2");
            target.InputEachLine("\"f1\",\"f2\"");
            target.InputEachLine("\"f1\",\"f2\"");
            var actual = target.Result;

            var expected = "new A { F1 = \"f1\", F2 = \"f2\", },\nnew A { F1 = \"f1\", F2 = \"f2\", },\n";

            expected.ToExpectedObject().ShouldEqual(actual);
        }