Exemple #1
0
        public void AdaptiveThreshold_SettingThresholdLimit_Works()
        {
            // arrange
            var expectedThresholdLimit = .65f;

            // act
            this.operations.AdaptiveThreshold(expectedThresholdLimit);

            // assert
            AdaptiveThresholdProcessor p = this.Verify <AdaptiveThresholdProcessor>();

            Assert.Equal(expectedThresholdLimit, p.ThresholdLimit);
            Assert.Equal(Color.White, p.Upper);
            Assert.Equal(Color.Black, p.Lower);
        }
Exemple #2
0
        public void AdaptiveThreshold_SettingUpperLowerThresholds_Works()
        {
            // arrange
            Color expectedUpper = Color.HotPink;
            Color expectedLower = Color.Yellow;

            // act
            this.operations.AdaptiveThreshold(expectedUpper, expectedLower);

            // assert
            AdaptiveThresholdProcessor p = this.Verify <AdaptiveThresholdProcessor>();

            Assert.Equal(expectedUpper, p.Upper);
            Assert.Equal(expectedLower, p.Lower);
        }
Exemple #3
0
        public void AdaptiveThreshold_SettingUpperLowerWithThresholdLimit_WithRectangle_Works()
        {
            // arrange
            var   expectedThresholdLimit = .77f;
            Color expectedUpper          = Color.HotPink;
            Color expectedLower          = Color.Yellow;

            // act
            this.operations.AdaptiveThreshold(expectedUpper, expectedLower, expectedThresholdLimit, this.rect);

            // assert
            AdaptiveThresholdProcessor p = this.Verify <AdaptiveThresholdProcessor>(this.rect);

            Assert.Equal(expectedThresholdLimit, p.ThresholdLimit);
            Assert.Equal(expectedUpper, p.Upper);
            Assert.Equal(expectedLower, p.Lower);
        }
Exemple #4
0
        public void AdaptiveThreshold_UsesDefaults_Works()
        {
            // arrange
            var   expectedThresholdLimit = .85f;
            Color expectedUpper          = Color.White;
            Color expectedLower          = Color.Black;

            // act
            this.operations.AdaptiveThreshold();

            // assert
            AdaptiveThresholdProcessor p = this.Verify <AdaptiveThresholdProcessor>();

            Assert.Equal(expectedThresholdLimit, p.ThresholdLimit);
            Assert.Equal(expectedUpper, p.Upper);
            Assert.Equal(expectedLower, p.Lower);
        }