示例#1
0
        public void TestScaleAndTranslate(int offsetX, int offsetY)
        {
            var offset = new SKPointI(offsetX, offsetY);

            _observation.ScaleAndTranslate(
                new SKSizeI(SharedConstants.DefaultChipWidth, SharedConstants.DefaultChipHeight), offset);
            var expectedBoundingBox = new SKRect(
                _rect.Left * SharedConstants.DefaultChipWidth + offsetX,
                _rect.Top * SharedConstants.DefaultChipHeight + offsetY,
                _rect.Right * SharedConstants.DefaultChipWidth + offsetX,
                _rect.Bottom * SharedConstants.DefaultChipHeight + offsetY);

            Assert.AreEqual(_category, _observation.Category);
            Assert.AreEqual(_confidence, _observation.Confidence);
            AssertUtils.AreEqualSKRect(expectedBoundingBox, _observation.BoundingBox);
        }