示例#1
0
        public void NoResultFromDatabase()
        {
            var profile  = new Profile.Profile();
            var database = new Fake.Database(profile);

            database.Connect();

            Assert.AreEqual("0.0.0-Nil", database.SchemaVersion().ToString());
        }
示例#2
0
        public void NormalFullResult()
        {
            var profile  = new Profile.Profile();
            var database = new Fake.Database(profile);

            database.Connect();

            database.Add(new string[3] {
                "Business", "1.2.3", "4"
            });

            Assert.AreEqual("Business1.2.3-4", database.SchemaVersion().ToString());
        }
示例#3
0
        public void DataReadError()
        {
            var log     = new Core.Fake.Log();
            var profile = new Profile.Profile()
            {
                Log = log
            };
            var database = new Fake.Database(profile)
            {
                // Driver specific Exception
                ReaderGetException = new System.Exception("Before start of result set")
            };

            database.Connect();

            database.Add(new string[3] {
                "Business", "1.2.3", "4"
            });

            Assert.AreEqual("0.0.0-Nil", database.SchemaVersion().ToString());
            Assert.That(log.Output, Contains.Substring(Log.Level.Error.ToString()));
            Assert.That(log.Output, Contains.Substring("Before start"));
            Assert.That(log.Output, Contains.Substring("Version"));
        }