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())); }
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())); }
public void Loads_template_from_resource() { var fakeFileWriter = new FakeTextWriter(); var generator = new SparkResultReportGenerator(fakeFileWriter, ""); generator.Handle(new GatheredResultSet()); fakeFileWriter.Result.ShouldBeValidXml(); }
public void SetupContext() { FileWriter = new FakeTextWriter(); Writer = new XmlReportListener(FileWriter); DoTestSetup(Writer); Result = FileWriter.Result; Debug.WriteLine(Result); }
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); } }
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); } }