public void UsingFormat_Must_Throw_If_Format_Is_Set_To_Null() { var parameter = new OutputFileWithFormatParameter( new OutputFileParameter("a"), OutputFormat.ClientSideImageMap ); new FileOutputExpression(parameter).UsingFormat(null); }
/// <summary> /// Specifies that the dot output should be written to a file. /// </summary> /// <param name="fileName">Name of the file to write the output of the dot executable to.</param> /// <returns> /// An expression that can be used to specify file output parameters. /// </returns> public IFileOutputExpression ToFile(string fileName) { var parameter = new OutputFileWithFormatParameter( new OutputFileParameter(fileName), configurationProvider.DefaultFileFormat ); outputParameters.Add(parameter); return new FileOutputExpression(parameter); }
public void ToCommandLine_Should_Write_Parameters_Correctly() { const string fileName = "c:\\tmp\\a.gif"; var outputFile = new OutputFileParameter(fileName); OutputFormat format = OutputFormat.GIF; var parameter = new OutputFileWithFormatParameter(outputFile, format); string commandLine = parameter.ToCommandLine(); Assert.AreEqual(commandLine, String.Format("{0} {1}", format.ToCommandLine(), outputFile.ToCommandLine())); }
public void Constructor_Should_Set_Properties() { const string fileName = "c:\\tmp\\a.gif"; var outputFile = new OutputFileParameter(fileName); OutputFormat format = OutputFormat.GIF; var parameter = new OutputFileWithFormatParameter(outputFile, format); Assert.AreEqual(parameter.Format, format); Assert.AreEqual(parameter.OutputFile, outputFile); }
public void UsingFormat_Must_Set_Format_On_Parameter() { var parameter = new OutputFileWithFormatParameter( new OutputFileParameter("a"), OutputFormat.ClientSideImageMap ); new FileOutputExpression(parameter).UsingFormat(OutputFormat.GD); Assert.AreEqual(parameter.Format, OutputFormat.GD); Assert.AreEqual(parameter.OutputFile.FileName, "a"); }
/// <summary> /// Initializes a new instance of the <see cref="FileOutputExpression"/> class. /// </summary> /// <param name="fileParameter">The file parameter.</param> public FileOutputExpression(OutputFileWithFormatParameter fileParameter) { this.fileParameter = fileParameter; }