public void ParseCommand_IlegalUrlPart_InvalidCommand() { const string inFile = "D:\\Programing\\Cs_Programming_I\\04\\nezarka_store\\test_files\\CommandParsingTests\\IlegalUrlPartTest.in"; const string correctFile = "D:\\Programing\\Cs_Programming_I\\04\\nezarka_store\\test_files\\CommandParsingTests\\IlegalUrlPartExpected.out"; const string outFile = "D:\\Programing\\Cs_Programming_I\\04\\nezarka_store\\test_files\\CommandParsingTests\\IlegalUrlPartTest.out"; Reader = File.OpenText(inFile); Heimdal = new SupremeCommander(); Writer = new StreamWriter(new FileStream(outFile, FileMode.OpenOrCreate, FileAccess.ReadWrite)); Overseer = new StoreViewer(Writer); Heimdal.GetData(Reader, out bool wrongInput); Heimdal.InititateCommandProcessing(Reader, Overseer); Heimdal.DisposeStore(); Writer.Close(); bool areEqual = Utils.FileDiff(outFile, correctFile); Assert.IsTrue(areEqual); }
public void RunAll_CorrectInput_CreatesFile() { StreamWriter wrt = new StreamWriter(new FileStream("D:\\Programing\\Cs_Programming_I\\04\\nezarka_store\\test_files\\CompleteTests\\NezarkaTest.out", FileMode.OpenOrCreate, FileAccess.ReadWrite)); StoreViewer storeViewer = new StoreViewer(wrt); SupremeCommander Thor = new SupremeCommander(); bool wrongStoreInput; TextReader myReader = File.OpenText("D:\\Programing\\Cs_Programming_I\\04\\nezarka_store\\test_files\\CompleteTests\\NezarkaTest.in"); Thor.GetData(myReader, out wrongStoreInput); if (wrongStoreInput) { Thor.PrintDataError(); return; } Thor.InititateCommandProcessing(myReader, storeViewer); wrt.Close(); bool identical = Utils.FileDiff("D:\\Programing\\Cs_Programming_I\\04\\nezarka_store\\test_files\\CompleteTests\\NezarkaTest.out", "D:\\Programing\\Cs_Programming_I\\04\\nezarka_store\\test_files\\CompleteTests\\NezarkaExpected.out"); Assert.IsTrue(identical); }