예제 #1
0
        public void When_template_file_does_not_exist_throws_a_sensible_exception()
        {
            var fakeFileWriter = new FakeTextWriter();
            var generator      = new SparkResultReportGenerator(fakeFileWriter, "C:\\this\\does\\not\\exist.spark");

            Expect.ThisToThrow <TemplateNotFoundException>(() => generator.Handle(new GatheredResultSet()));
        }
예제 #2
0
        public void When_template_file_does_not_exist_throws_a_sensible_exception()
        {
            var fakeFileWriter = new FakeTextWriter();
            var generator = new SparkReportGenerator(fakeFileWriter, "C:\\this\\does\\not\\exist.spark");

            Expect.ThisToThrow<TemplateNotFoundException>(() => generator.Handle(new GatheredResultSet()));
        }
예제 #3
0
        public void Loads_template_from_resource()
        {
            var fakeFileWriter = new FakeTextWriter();
            var generator      = new SparkResultReportGenerator(fakeFileWriter, "");

            generator.Handle(new GatheredResultSet());

            fakeFileWriter.Result.ShouldBeValidXml();
        }
예제 #4
0
        public void SetupContext()
        {
            FileWriter = new FakeTextWriter();

            Writer = new XmlReportListener(FileWriter);

            DoTestSetup(Writer);
            Result = FileWriter.Result;
            Debug.WriteLine(Result);
        }
예제 #5
0
        public void SetupContext()
        {
            var fakeFileWriter = new FakeTextWriter();

            string pathToTemplate = Path.GetTempFileName();
            File.WriteAllText(pathToTemplate, GetView());
            try
            {
                var generator = new SparkReportGenerator(fakeFileWriter, pathToTemplate);

                generator.Handle(GetTestResult());
                Result = fakeFileWriter.Result;
            }
            finally
            {
                File.Delete(pathToTemplate);
            }
        }
예제 #6
0
        public void SetupContext()
        {
            var fakeFileWriter = new FakeTextWriter();

            string pathToTemplate = Path.GetTempFileName();

            File.WriteAllText(pathToTemplate, GetView());
            try
            {
                var generator = new SparkResultReportGenerator(fakeFileWriter, pathToTemplate);

                generator.Handle(GetTestResult());
                Result = fakeFileWriter.Result;
            }
            finally
            {
                File.Delete(pathToTemplate);
            }
        }
        public void SetupContext()
        {
            FileWriter = new FakeTextWriter();

            Writer = new XmlReportListener(FileWriter);

            DoTestSetup(Writer);
            Result = FileWriter.Result;
            Debug.WriteLine(Result);
        }
예제 #8
0
        public void Loads_template_from_resource()
        {
            var fakeFileWriter = new FakeTextWriter();
            var generator = new SparkResultReportGenerator(fakeFileWriter, "");

            generator.Handle(new GatheredResultSet());

            fakeFileWriter.Result.ShouldBeValidXml();
        }