Beispiel #1
0
        public void Test_Injection_WithoutServiceProvider()
        {
            PageDescriptor page   = this.locator.FindPage("InjectedQuery", typeof(MiscAccessor));
            ProcEngine     engine = new ProcEngine(null);

            Should.Throw <NotSupportedException>(() => engine.Proc(page, new ProcArgs(typeof(object), typeof(object)))(null));
        }
Beispiel #2
0
        public void Test_ProjectionAndInjection_WithServiceProvider()
        {
            PageDescriptor page   = this.locator.FindPage("DiQuery", typeof(DiAccessor));
            ProcEngine     engine = new ProcEngine(this.GetServiceProvider());

            ISqlContent result = engine.Proc(page, new ProcArgs(typeof(object), typeof(object)))(null).Buffer.ReadToEnd();

            result.Text.ShouldBe("SOMEVALUE+PROJ");
        }
Beispiel #3
0
        public void Test_Projection_WithoutServiceProvider()
        {
            PageDescriptor page   = this.locator.FindPage("ProjectedQuery", typeof(MiscAccessor));
            ProcEngine     engine = new ProcEngine(null);

            ISqlContent result = engine.Proc(page, new ProcArgs(typeof(object), typeof(object)))(null).Buffer.ReadToEnd();

            result.Text.ShouldBe("PROJEXISTS");
        }