public void ToByteArrayTest(CaptureImage ci, IEnumerable <byte> startsWith, int length) { ci.ToByteArray() .Should() .StartWith(startsWith) .And .HaveCount(length); }
public void CaptureImage() { var img = new CaptureImage(TestUtil.DummyBitmapSource(2, 2)) { JpegQualityLevel = 100 }; img.ImageRatioSize.Width = 10; var mock = new Mock <IDragInfo>(); mock.SetupGet(d => d.Data).Returns(img); new ImageDragSource().StartDrag(mock.Object); mock.VerifySet(d => d.DataFormat = DataFormats.GetDataFormat(DataFormats.Bitmap), Times.Once()); mock.VerifySet(d => d.DataObject = It.Is(img.TransformedImage, new LambdaEqualityComparer <object>(VerifyDataObject)), Times.Once());