public virtual void Setup()
        {
            var memStream = new MemoryStream();
            var listener = new XmlOutputEventListener(new XmlTextWriter(memStream, Encoding.UTF8));

            ConfigurationNoAppDomain
                .New
                .SetScenarioFiles(_feature)
                .SetAssemblies(new[] {GetType().Assembly.Location})
                .SetEventListener(listener)
                .Build()
                .Run();

            _xmlDoc = new XmlDocument();
            memStream.Seek(0, 0);
            _xmlDoc.Load(memStream);
        }
            public void SetUp()
            {
                var writer = new XmlTextWriter(new MemoryStream(), Encoding.UTF8);
                var listener = new XmlOutputEventListener(writer);

                const string scenarioText = "Feature: " + FeatureTitle + "\r\n" +
                                            "Scenario: Reading values from a config file\r\n" +
                                            "Given an assembly with a matching configuration file\r\n" +
                                            "When the value of setting foo is read\r\n" +
                                            "Then the value should be bar";

                SetupConfigFile();
                runner = CreateTextRunner(new[] { "TestPlainTextAssembly.dll" }, listener, scenarioText);

                results = runner.Run();

                xmlOut = new XmlDocument();
                writer.BaseStream.Seek(0, SeekOrigin.Begin);
                xmlOut.Load(writer.BaseStream);
            }
Ejemplo n.º 3
0
            public void SetUp()
            {
                var writer = new XmlTextWriter(new MemoryStream(), Encoding.UTF8);
                var listener = new XmlOutputEventListener(writer);

                CreateBasicConfiguration()
                    .SetEventListener(listener)
                    .SetScenarioFiles(new[] { TestFeatures.FeatureWithFailingStep })
                    .Build()
                    .Run();

                _xmlOut = new XmlDocument();
                writer.BaseStream.Seek(0, SeekOrigin.Begin);
                _xmlOut.Load(writer.BaseStream);
            }