public void Adding_And_Removing_Custom_Works()
        {
            var provider = new MyDatabaseProvider();

            DefaultCompilers.TryGetCustom(provider.GetType(), out var compiler).Should().BeFalse();

            DefaultCompilers.RegisterFor <MyDatabaseProvider>(new PercentCompiler());

            DefaultCompilers.TryGetCustom(provider, out compiler).Should().BeTrue();
            compiler.Should().BeOfType <PercentCompiler>();

            DefaultCompilers.RegisterFor <MyDatabaseProvider>(null);
            DefaultCompilers.TryGetCustom(provider.GetType(), out compiler).Should().BeFalse();
        }
        public void Query_Uses_Custom_Compiler()
        {
            try
            {
                _mockDb.Setup(m => m.Provider).Returns(new MySqlDatabaseProvider());
                DefaultCompilers.RegisterFor <MySqlDatabaseProvider>(new PercentCompiler());

                var input    = new Query("Foo").Select("Bar");
                var output   = _mockDb.Object.Query <SomeClass>(input);
                var expected = "SELECT %%Bar%% FROM %%Foo%%";

                _lastSql.Should().BeEquivalentTo(new Sql(expected));
            }
            finally
            {
                DefaultCompilers.RegisterFor <MySqlDatabaseProvider>(null);
            }
        }