public void ByteViewer_SaveToFile_InvokeWithBytes_Success() { using var control = new ByteViewer(); control.SetBytes(new byte[] { 1, 2, 3 }); string path = "ByteViewerContent"; try { control.SaveToFile(path); Assert.Equal(new byte[] { 1, 2, 3 }, File.ReadAllBytes(path)); } finally { File.Delete(path); } }
public void ByteViewer_SaveToFile_InvokeInvalidPath_ThrowsArgumentException(string path) { using var control = new ByteViewer(); control.SetBytes(Array.Empty <byte>()); Assert.Throws <ArgumentException>("path", () => control.SaveToFile(path)); }
public void ByteViewer_SaveToFile_InvokeNullPath_ThrowsArgumentNullException() { using var control = new ByteViewer(); control.SetBytes(Array.Empty <byte>()); Assert.Throws <ArgumentNullException>("path", () => control.SaveToFile(null)); }
public void ByteViewer_SaveToFile_InvokeNoBytes_Nop(string path) { using var control = new ByteViewer(); control.SaveToFile(path); }