Exemplo n.º 1
0
        public void get_transformer_delegates_to_the_service_locator()
        {
            var transformer = new StubTransformer();

            MockFor <IServiceLocator>().Stub(x => x.GetInstance <StubTransformer>())
            .Return(transformer);

            ClassUnderTest.GetTransformer <StubTransformer>().ShouldBeTheSameAs(transformer);
        }
Exemplo n.º 2
0
        public void CallsTransformerWhenAssemblyIsFinished()
        {
            TestableTestRunner runner = TestableTestRunner.CreateForAssembly();
            StubTransformer transformer = new StubTransformer();

            runner.RunAssembly(new IResultXmlTransform[] { transformer });

            Assert.True(transformer.Transform__Called);
            Assert.Equal(runner.Executor.RunAssembly__Result.OuterXml, transformer.Transform_Xml);
        }
Exemplo n.º 3
0
        public void CallsTransformerWhenAssemblyIsFinished()
        {
            TestableTestRunner runner      = TestableTestRunner.CreateForAssembly();
            StubTransformer    transformer = new StubTransformer();

            runner.RunAssembly(new IResultXmlTransform[] { transformer });

            Assert.True(transformer.Transform__Called);
            Assert.Equal(runner.Executor.RunAssembly__Result.OuterXml, transformer.Transform_Xml);
        }
        public void TransformerIsAppliedToCompileUnit()
        {
            StubTransformer transformer = new StubTransformer();

            TransformerCompilerStep transformerStep = new TransformerCompilerStep(transformer);

            CompileUnit unit = new CompileUnit();

            BooCompiler compiler = new BooCompiler();
            compiler.Parameters.Pipeline = new CompilerPipeline();
            compiler.Parameters.Pipeline.Insert(0, transformerStep);
            compiler.Run(unit);

            Assert.IsTrue(transformer.CompileUnitVisited);
        }
Exemplo n.º 5
0
        public void TransformerIsAppliedToCompileUnit()
        {
            StubTransformer transformer = new StubTransformer();

            TransformerCompilerStep transformerStep = new TransformerCompilerStep(transformer);

            CompileUnit unit = new CompileUnit();

            BooCompiler compiler = new BooCompiler();

            compiler.Parameters.Pipeline = new CompilerPipeline();
            compiler.Parameters.Pipeline.Insert(0, transformerStep);
            compiler.Run(unit);

            Assert.True(transformer.CompileUnitVisited);
        }