示例#1
0
        public void BuildSpotset_Works1()
        {
            var userSettings = new Mock <IUserSettings>(MockBehavior.Strict);

            userSettings
            .SetupProperty(s => s.SpotsX, 1)
            .SetupProperty(s => s.SpotsY, 1)
            .SetupProperty(s => s.BorderDistanceX, 0)
            .SetupProperty(s => s.BorderDistanceY, 0)
            .SetupProperty(s => s.OffsetLed, 0)
            .SetupProperty(s => s.SpotWidth, 90)
            .SetupProperty(s => s.SpotHeight, 80)
            ;
            var spots = SpotSet.BuildSpots(180, 120, userSettings.Object);

            Assert.IsNotNull(spots, "spotset.Spots");
            Assert.AreEqual(4, spots.Length, "spotset.Spots.Length");
            Assert.AreEqual(new Rectangle(84, 0, 90 / 8, 80 / 8), spots[0].Rectangle, "spots[0].Rectangle");
        }
示例#2
0
        public void BuildSpotset_2x2_Offset2_works()
        {
            var userSettings = new Mock <IUserSettings>(MockBehavior.Strict);

            userSettings
            .SetupProperty(s => s.SpotsX, 2)
            .SetupProperty(s => s.SpotsY, 2)
            .SetupProperty(s => s.BorderDistanceX, 1)
            .SetupProperty(s => s.BorderDistanceY, 1)
            .SetupProperty(s => s.OffsetLed, 2)
            .SetupProperty(s => s.SpotWidth, 10)
            .SetupProperty(s => s.SpotHeight, 10)
            .SetupProperty(s => s.MirrorX, false)
            .SetupProperty(s => s.MirrorY, false)
            ;

            var spots = SpotSet.BuildSpots(1920, 1080, userSettings.Object);

            Assert.IsNotNull(spots, "spotset.Spots");
            Assert.AreEqual(2 + 2 + 2 + 2, spots.Length, "spotset.Spots.Length");
            Assert.AreEqual(new Rectangle(0, 719, 1, 1), spots[0].Rectangle, "spotset.Spots[0].Rectangle");
        }
示例#3
0
        public void BuildSpotset_4k_BorderDistance_1()
        {
            var userSettings = new Mock <IUserSettings>(MockBehavior.Strict);

            userSettings
            .SetupProperty(s => s.SpotsX, 40)
            .SetupProperty(s => s.SpotsY, 25)
            .SetupProperty(s => s.BorderDistanceX, 1)
            .SetupProperty(s => s.BorderDistanceY, 1)
            .SetupProperty(s => s.OffsetLed, 0)
            .SetupProperty(s => s.SpotWidth, 28)
            .SetupProperty(s => s.SpotHeight, 30)
            .SetupProperty(s => s.MirrorX, false)
            .SetupProperty(s => s.MirrorY, false)
            ;

            var spots = SpotSet.BuildSpots(3840 / 8, 2160 / 8, userSettings.Object);

            Assert.IsNotNull(spots, "spotset.Spots");
            Assert.AreEqual(40 + 40 + 25 + 25, spots.Length, "spotset.Spots.Length");
            Assert.AreEqual(new Rectangle(11, 0, 28 / 8, 30 / 8), spots[0].Rectangle, "spotset.Spots[0].Rectangle");
        }