public FormatOutputPath ( string formatString ) : string | ||
formatString | string | /// The format string to use. /// |
return | string |
public string TestOutputFormat(string format) { // Creat the result. var result = new FileResult { Checked = true, Show = this.TestShows.First(), InputFile = Substitute.For<IFileInfo>() }; result.Episode = result.Show.Episodes.First(); result.Episodes = new List<Episode> { result.Episode }; result.InputFile.Extension.Returns(".avi"); // Format the string. return result.FormatOutputPath(format); }
public void DualEpisodeFormatting() { // Creat the result. var result = new FileResult { Checked = true, Show = this.TestShows.First(), InputFile = Substitute.For<IFileInfo>() }; result.Episode = result.Show.Episodes.First(); result.Episodes = new List<Episode> { result.Episode, result.Show.Episodes[1] }; result.InputFile.Extension.Returns(".avi"); // Format the string. string output = result.FormatOutputPath("{SName(.)}.S{SNum(2)}E{ENum(2)}.{EName(.)}"); Assert.AreEqual( "Alpha.Show.S01E01-02.Episode.One.(1-2)", output, "The output format does not match what it should be."); }