Exemple #1
0
        public void Should_be_possible_to_transform_a_sqlQueryResult_into_a_list_of_ovalSimpleAnyType()
        {
            var ovalSimpleTypes = FakeSqlQueryResult.ToOvalSimpleTypeList();

            Assert.IsNotNull(ovalSimpleTypes);
            Assert.AreEqual(2, ovalSimpleTypes.Count());
            Assert.AreEqual("John Doe", ovalSimpleTypes.ElementAt(0).Value);
            Assert.AreEqual("Barack Obama", ovalSimpleTypes.ElementAt(1).Value);
        }
Exemple #2
0
        public void Should_be_possible_to_transform_a_sqlQueryResult_with_no_result_into_a_list_of_ovalSimpleAnyType()
        {
            var emptySqlQueryResult = new SqlQueryResult();

            var ovalSimpleTypes = emptySqlQueryResult.ToOvalSimpleTypeList();

            Assert.IsNotNull(ovalSimpleTypes);
            Assert.AreEqual(1, ovalSimpleTypes.Count());
            Assert.AreEqual(StatusEnumeration.doesnotexist, ovalSimpleTypes.ElementAt(0).status);
        }
Exemple #3
0
        public void Should_be_possible_to_transform_a_sqlQueryResult_with_empty_field_into_a_list_of_ovalSimpleAnyType()
        {
            var fakeSqlQueryResult = new SqlQueryResult();

            fakeSqlQueryResult.AddRecord(CreateFakeRecord(new string[] { "name" }, new object[] { "John" }));
            fakeSqlQueryResult.AddRecord(CreateFakeRecord(new string[] { "name" }, new object[] { null }));
            fakeSqlQueryResult.AddRecord(CreateFakeRecord(new string[] { "name" }, new object[] { "Mark" }));

            var ovalSimpleTypes = fakeSqlQueryResult.ToOvalSimpleTypeList();

            Assert.IsNotNull(ovalSimpleTypes);
            Assert.AreEqual(3, ovalSimpleTypes.Count());
            Assert.AreEqual("John", ovalSimpleTypes.ElementAt(0).Value);
            Assert.AreEqual("Mark", ovalSimpleTypes.ElementAt(2).Value);
            var nullField = ovalSimpleTypes.ElementAt(1);

            Assert.IsNull(nullField.Value);
            Assert.AreEqual(StatusEnumeration.doesnotexist, nullField.status);
        }