Пример #1
0
        public void BeforeAll()
        {
            var finder = new DefaultSpecificationFinder(new DefaultFileSystem());
            var expressionRunner = new DefaultExpressionRunnerFactory().CreateExpressionRunner(false);
            var formatter = new SilentConsoleFormatter(new DefaultConsoleWritter());
            runner = new DefaultSpecificationRunner(expressionRunner, finder, formatter);

            var location = new Uri(typeof(TestSpecificationConfigurationManager).Assembly.CodeBase).LocalPath;
            var appDomain = new SpecificationAppDomain(runner);
            var results = appDomain.ExecuteSpecifications(location);
            
            using (var stream = new MemoryStream()) {
                var reporter = new NUnitSpecificationReporter();
                reporter.Write(stream, results);
                stream.Seek(0, SeekOrigin.Begin);

                var serializer = new XmlSerializer(typeof(resultType));
                using (var reader = XmlReader.Create(stream)) {
                    resultType = (resultType)serializer.Deserialize(reader);
                }
            }
        }
Пример #2
0
        public void BeforeAll()
        {
            var finder           = new DefaultSpecificationFinder(new DefaultFileSystem());
            var expressionRunner = new DefaultExpressionRunnerFactory().CreateExpressionRunner(false);
            var formatter        = new SilentConsoleFormatter(new DefaultConsoleWritter());

            runner = new DefaultSpecificationRunner(expressionRunner, finder, formatter);

            var location  = new Uri(typeof(TestSpecificationConfigurationManager).Assembly.CodeBase).LocalPath;
            var appDomain = new SpecificationAppDomain(runner);
            var results   = appDomain.ExecuteSpecifications(location);

            using (var stream = new MemoryStream()) {
                var reporter = new NUnitSpecificationReporter();
                reporter.Write(stream, results);
                stream.Seek(0, SeekOrigin.Begin);

                var serializer = new XmlSerializer(typeof(resultType));
                using (var reader = XmlReader.Create(stream)) {
                    resultType = (resultType)serializer.Deserialize(reader);
                }
            }
        }