コード例 #1
0
        public static void ShouldRecreateSchemaSQLite()
        {
            Database reproduceIn = RegisterSQLiteForConnection("ReproSchemaSQLite");

            DropAllTables(reproduceIn);
            Incubator sp = reproduceIn.ServiceProvider;

            SQLiteRegistrar.Register(reproduceIn.ServiceProvider);

            SchemaWriter writer = sp.GetNew <SchemaWriter>();

            Expect.IsTrue(writer is SQLiteSqlStringBuilder);
            Expect.IsTrue(writer.WriteSchemaScript <Item>(), "WriteSchemaScript returned false instead of true");
            Exception e;
            bool      executeResult = writer.TryExecute(reproduceIn, out e);

            Expect.IsNull(e, e == null ? "" : e.Message); // no exception should have occurred

            Expect.IsTrue(executeResult, "TryExecute returned false instead of true");

            Expect.IsFalse(writer.WriteSchemaScript <Item>(), "WriteSchemaScript returned true instead of false");
        }