예제 #1
0
        public void CreateConnectionTest()
        {
            SqlCeConnection expected = new SqlCeConnection("Data Source = PTDatabase.sdf");
            SqlCeConnection actual   = PTDatabase.Connection();

            SqlCeConnectionEqual(expected, actual);
        }
예제 #2
0
        public void CreateConnectionWithFilePathTest()
        {
            var             sdfPath            = "PTDatabase.sdf";
            SqlCeConnection expectedConnection = new SqlCeConnection("Data Source = " + sdfPath);
            bool            expected           = true;
            bool            created            = PTDatabase.CreateConnectionWithSDFFile(sdfPath);
            SqlCeConnection actualConnction    = PTDatabase.Connection();

            Assert.AreEqual(expected, created);
            Assert.AreEqual(expected, File.Exists(sdfPath));
            SqlCeConnectionEqual(expectedConnection, actualConnction);
        }