public void TwoValidFileNamesAndValidWidth_WritesProperScaledWidth() { int width = 100; ImageToAscii.ConvertToAscii(_inputFileNames[0], _outputFileName, width); // ReadLines eats the line endings, so no need to account for their width. Assert.AreEqual(width, File.ReadLines(_outputFileName).ToList()[0].Length); }
public void BitmapAndFileNameAndValidWidth_WritesSomethingToFile() { int width = 200; ImageToAscii.ConvertToAscii(_inputs["cat.jpg"], _outputFileName, width); Assert.IsTrue(File.Exists(_outputFileName)); Assert.AreNotEqual(0, File.ReadAllText(_outputFileName).Length); }
public void ValidGradientBitmapInput_WritesAllCharacters() { ImageToAscii.ConvertToAscii(_inputs["gradient.jpg"], _outputFileName, 500); string outputContents = File.ReadAllText(_outputFileName); foreach (var character in ImageToAscii.CharacterSet) { Assert.IsTrue(outputContents.Contains(character)); } }
public void TwoValidFileNames_WritesMoreThanZeroLines() { ImageToAscii.ConvertToAscii(_inputFileNames[0], _outputFileName); Assert.AreNotEqual(0, File.ReadLines(_outputFileName).ToList().Count); }