public void FileDelete_NoStatusOrDone_ThrowsException() { var file = new File("symitar", "000", "RandomFile", FileType.RepGen, DateTime.Now, 100); var mockSocket = Substitute.For <ISymSocket>(); mockSocket.ReadCommand().Returns(new SymCommand("Unknown")); var session = new SymSession(mockSocket, 10); Assert.Throws <Exception>(() => session.FileDelete("RandomFile", FileType.RepGen)); }
public void FileDelete_CompletesSuccessfully_NoExceptions() { var mockSocket = Substitute.For <ISymSocket>(); mockSocket.ReadCommand() .Returns(new SymCommand("Rename", new Dictionary <string, string> { { "Done", "" } })); var session = new SymSession(mockSocket, 10); Assert.DoesNotThrow(() => session.FileDelete("RandomFile", FileType.RepGen)); }
public void FileDelete_StatusUnknown_ThrowsFileNotFoundException() { var file = new File("symitar", "000", "RandomFile", FileType.RepGen, DateTime.Now, 100); var mockSocket = Substitute.For <ISymSocket>(); mockSocket.ReadCommand() .Returns(new SymCommand("Rename", new Dictionary <string, string> { { "Status", "" } })); var session = new SymSession(mockSocket, 10); Assert.Throws <Exception>(() => session.FileDelete("RandomFile", FileType.RepGen), "Filename Too Long"); }
public void FileDelete_StatusUnknown_ThrowsFileNotFoundException() { var file = new File("symitar", "000", "RandomFile", FileType.RepGen, DateTime.Now, 100); var mockSocket = Substitute.For<ISymSocket>(); mockSocket.ReadCommand() .Returns(new SymCommand("Rename", new Dictionary<string, string> {{"Status", ""}})); var session = new SymSession(mockSocket, 10); Assert.Throws<Exception>(() => session.FileDelete("RandomFile", FileType.RepGen), "Filename Too Long"); }
public void FileDelete_NoStatusOrDone_ThrowsException() { var file = new File("symitar", "000", "RandomFile", FileType.RepGen, DateTime.Now, 100); var mockSocket = Substitute.For<ISymSocket>(); mockSocket.ReadCommand().Returns(new SymCommand("Unknown")); var session = new SymSession(mockSocket, 10); Assert.Throws<Exception>(() => session.FileDelete("RandomFile", FileType.RepGen)); }
public void FileDelete_CompletesSuccessfully_NoExceptions() { var mockSocket = Substitute.For<ISymSocket>(); mockSocket.ReadCommand() .Returns(new SymCommand("Rename", new Dictionary<string, string> {{"Done", ""}})); var session = new SymSession(mockSocket, 10); Assert.DoesNotThrow(() => session.FileDelete("RandomFile", FileType.RepGen)); }