Esempio n. 1
0
        public void ByteViewer_SetBytes_Invoke_GetReturnExpected(byte[] bytes)
        {
            using var control = new ByteViewer();
            control.SetBytes(bytes);
            Assert.Same(bytes, control.GetBytes());
            Assert.False(control.IsHandleCreated);

            // Set same.
            control.SetBytes(bytes);
            Assert.Same(bytes, control.GetBytes());
            Assert.False(control.IsHandleCreated);
        }
Esempio n. 2
0
 public void ByteViewer_SetFile_InvokeNoBytes_Success()
 {
     using var control   = new ByteViewer();
     using TempFile file = TempFile.Create(new byte[] { 1, 2, 3 });
     control.SetFile(file.Path);
     Assert.Equal(new byte[] { 1, 2, 3, 0 }, control.GetBytes());
 }
Esempio n. 3
0
 public void ByteViewer_GetBytes_Invoke_ReturnsExpected()
 {
     using var control = new ByteViewer();
     Assert.Null(control.GetBytes());
     Assert.False(control.IsHandleCreated);
 }