public void BookBalanceSQLite() { var profile = new Profile.Profile(); var database = new Fake.Database(profile); database.Connect(); var bookName = "Sales"; float bookAmount = 100.00F; database.Add(record1); database.Add(record2); System.Collections.Generic.List <Balance> entries = Function.SQLiteBookBalance(database, bookName, bookAmount); CheckTransaction(database); Assert.Greater(entries.Count, 1); Assert.IsNotNull(entries[0].Entry); Assert.Greater(entries[0].Entry, 0); Assert.AreEqual(record1[2], entries[0].Account); Assert.AreEqual(record2[2], entries[1].Account); Assert.AreEqual(1, database.Connection.OpenCount); Assert.Less(database.Connection.CloseCount, 2); }
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()); }
public void GetSingle() { var profile = new Profile.Profile(); var database = new Fake.Database(profile); database.Connect(); database.Add(new string[2] { "Stephen Arthur Jazdzewski", "Steve" }); var individual = new Individual(database, 3); Assert.AreEqual(3, individual.Id); Assert.AreEqual(true, individual.Person); Assert.AreEqual("Steve", individual.GoesBy); Assert.AreEqual("Stephen Arthur Jazdzewski", individual.FullName); }
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")); }