Beispiel #1
0
        public void FromStringArrayTest()
        {
            var fields   = new[] { "F1", "F2", "F3" };
            var expected = new[] { new Field("F1"), new Field("F2"), new Field("F3") };
            var actual   = (_fieldGenerator.FromArray(fields).Cast <IField>().ToArray());

            Assert.AreEqual(expected.Count(), actual.Count());
            Assert.AreEqual(expected[0].Name, actual[0].Name);
            Assert.AreEqual(expected[1].Name, actual[1].Name);
            Assert.AreEqual(expected[2].Name, actual[2].Name);
        }
Beispiel #2
0
        public void Select_FieldArray()
        {
            const string expected = "Select F1, F2, F3";

            var fieldGenerator = new FieldGenerator();
            var fields         = fieldGenerator.FromArray(new[] { "F1", "F2", "F3" });

            Generator.Select(fields);

            Assert.AreEqual(expected, Generator.ToString());
        }
Beispiel #3
0
        public void Select_FieldArray_WithSource()
        {
            const string expected = "Select Tab1.F1, Tab1.F2, Tab1.F3";

            var fieldGenerator = new FieldGenerator();
            var fields         = fieldGenerator.FromArray(new[] {
                new Field("F1", "Tab1"),
                new Field("F2", "Tab1"),
                new Field("F3", "Tab1")
            });

            Generator.Select(fields);

            Assert.AreEqual(expected, Generator.ToString());
        }