public Boolean readFromFile(RubikFileReader p_reader) { int l_int; l_int = p_reader.read(); //Console.Write("%d ",l_int); while ((l_int == ' ') || (l_int == 13 /*'\r'*/)) { l_int = p_reader.read(); // Console.Write("%d ",l_int); } if ((l_int == /*'\n'*/ 10) || (l_int == -1 /*EOF*/) || (l_int != '(')) { return(false); } else { c_face = FaceHandler.getFace((int)Char.GetNumericValue((char)(p_reader.read()))); p_reader.read(); c_direction = DirectionHandler.getDirection((int)Char.GetNumericValue((char)(p_reader.read()))); p_reader.read(); return(true); } }
public void write() { RubikFileWriter myWriter = new RubikFileWriter("Test.txt"); myWriter.write("testWrite"); myWriter.close(); RubikFileReader myReader = new RubikFileReader(("Test.txt")); int l_int; String l_readString = ""; while ((l_int = myReader.read()) != -1) { l_readString += (char)l_int; } Assert.AreEqual("testWrite", l_readString); }