Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
 public void ByteViewer_SaveToFile_InvokeNullPath_ThrowsArgumentNullException()
 {
     using var control = new ByteViewer();
     control.SetBytes(Array.Empty <byte>());
     Assert.Throws <ArgumentNullException>("path", () => control.SaveToFile(null));
 }
Esempio n. 4
0
 public void ByteViewer_SaveToFile_InvokeNoBytes_Nop(string path)
 {
     using var control = new ByteViewer();
     control.SaveToFile(path);
 }