Exemple #1
0
        public void Guid_SelectConsistency()
        {
            const string tableDDL = @"CREATE TABLE [Table] (
	ID INTEGER PRIMARY KEY AUTOINCREMENT,
	Data1 UNIQUEIDENTIFIER NOT NULL
)";
            var          dbFile   = Tools.Paths.GenerateTempFilename();

            try {
                SystemLog.RegisterLogger(new ConsoleLogger());
                var guid = Guid.NewGuid();
                SystemLog.Debug("Generated Guid: {0}", guid);

                var dac = Tools.Sqlite.Create(dbFile, logger: SystemLog.Logger);
                dac.ExecuteNonQuery(tableDDL);

                dac.Insert("Table", new[] { new ColumnValue("Data1", guid) });

                var read = dac.Select("Table", new[] { "Data1" }, columnMatches: new[] { new ColumnValue("Data1", guid), }).Single().Get <Guid>(0);
                Assert.AreEqual(guid, read);
            } finally {
                if (File.Exists(dbFile))
                {
                    File.Delete(dbFile);
                }
            }
        }
Exemple #2
0
 static void Main()
 {
     System.Windows.Forms.Application.EnableVisualStyles();
     System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
     AppDomain.CurrentDomain.UnhandledException       += (s, e) => Tools.Lambda.ActionIgnoringExceptions(() => ExceptionDialog.Show("Error", (Exception)e.ExceptionObject)).Invoke();
     System.Windows.Forms.Application.ThreadException += (xs, xe) => Tools.Lambda.ActionIgnoringExceptions(() => ExceptionDialog.Show("Error", xe.Exception)).Invoke();
     SystemLog.RegisterLogger(new ConsoleLogger());
     ComponentRegistry.Instance.RegisterApplicationBlock <TestBlock>(1);
     ComponentRegistry.Instance.RegisterApplicationBlock <TestBlock2>(2);
     Sphere10Framework.Instance.StartWinFormsApplication <BlockMainForm>();
 }