public void SubFontTools_TestExtractPngFilePathsFromLineList_ReturnFilenames() { var messenger = Substitute.For <IFrameworkMessenger>(); ISubFontTools tools = new SubFontTools(messenger); var lines = new List <string> { "nothing", "dirty text 23123&8734///", "page id=0 file=\"minstrel_96_0.png\"", "page id=1 file=\"minstrel_96_1.png\"", "page id=2 file=\"minstrel_96_2.png\"", "page id=3 file=\"minstrel_96_3.png\"", "page id=4 file=\"minstrel_96_4.png\"", "page id=5 file=\"minstrel_96_5.png\"", "page id=6 file=\"minstrel_96_6.png\"", "page id=7 file=\"minstrel_96_7.png\"", "extra poop", "how can this be broken?? png ?? ." }; var result = tools.ExtractPngFilePathsFromDotFntLines(lines); Assert.Equal(8, result.Count); Assert.Equal("minstrel_96_0.png", result[0]); Assert.Equal("minstrel_96_1.png", result[1]); Assert.Equal("minstrel_96_2.png", result[2]); Assert.Equal("minstrel_96_3.png", result[3]); Assert.Equal("minstrel_96_4.png", result[4]); Assert.Equal("minstrel_96_5.png", result[5]); Assert.Equal("minstrel_96_6.png", result[6]); Assert.Equal("minstrel_96_7.png", result[7]); }
public void SubFontTools_TestExtractPngFilePathsFromLineListNullInput_ReturnsZeroSizedArray() { var messenger = Substitute.For <IFrameworkMessenger>(); ISubFontTools tools = new SubFontTools(messenger); var result = tools.ExtractPngFilePathsFromDotFntLines(null); Assert.Empty(result); }
public void SubFontTools_TestExtractPngFilePathsFromLineListNoMatches_ReturnZeroSizedArray() { var messenger = Substitute.For <IFrameworkMessenger>(); ISubFontTools tools = new SubFontTools(messenger); var lines = new List <string> { "nothing", "dirty text 23123&8734///", "extra poop", "how can this be broken?? png ?? ." }; var result = tools.ExtractPngFilePathsFromDotFntLines(lines); Assert.Empty(result); }