예제 #1
0
        public void TestFakeSproc2()
        {
            UnitTestHelpers.ExecuteSQLCode("UnitTestPersonSelector.TestData.TestFakeSproc2.sql");

            var     personSelector = new PersonSelector();
            DataSet data           = personSelector.ReadNames();

            Assert.AreEqual(3, data.Tables[0].Rows.Count);
        }
예제 #2
0
        public void TestFakeSproc1()
        {
            UnitTestHelpers.ExecuteSQLCode("UnitTestPersonSelector.TestData.TestFakeSproc1.sql");

            var     personSelector = new PersonSelector();
            DataSet data           = personSelector.ReadNames();

            Assert.AreEqual(1, data.Tables[0].Rows.Count);
            Assert.AreEqual("Lisa", data.Tables[0].Rows[0]["first"].ToString());
        }
예제 #3
0
        public void TestMethod1()
        {
            // moved this to here so the fake stored procedures don't break this unit test
            ReadPersonNames.Instance.CreateStoredProcedure(UnitTestHelpers.InstanceName);

            using (var db = new ADODatabaseContext("TEST", "sampledata"))
            {
                db.ExecuteNonQuery("INSERT INTO person (first,last) VALUES ('Mary','Jane')");
                db.ExecuteNonQuery("INSERT INTO person (first,last) VALUES ('Joe','Cool')");
            }

            var     personSelector = new PersonSelector();
            DataSet data           = personSelector.ReadNames();

            Assert.AreEqual(2, data.Tables[0].Rows.Count);
        }