예제 #1
0
        protected override void Setup()
        {
            base.Setup();

            DbServiceMock.Setup(ds => ds.SettingsGetValue(It.Is <SettingsType>(st => st == SettingsType.DBVersion)))
            .Returns("2.0");
        }
        public void All_78_ConfigItemsLoaded()
        {
            configService.LoadSettings();

            DbServiceMock.Verify(m => m.SettingsGetValue(It.IsAny <SettingsType>()),
                                 Times.Exactly(78));
        }
        public void _78_ConfigItemsLoaded()
        {
            configService.SaveSettings();

            DbServiceMock.Verify(m => m.SettingsSetValue(It.IsAny <SettingsType>(), It.IsAny <string>()),
                                 Times.Exactly(78));
        }
        public void CamsDetectionWindowHeightLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.CamsDetectionWindowHeight))).Returns("546.5");
            configService.CamsDetectionWindowHeight = 1.0;
            configService.LoadSettings();

            configService.CamsDetectionWindowHeight.Should().Be(546.5);
        }
예제 #5
0
        protected override void Setup()
        {
            base.Setup();

            DbServiceMock.Setup(x => x.PlayersAllLoad()).Returns(PlayersDataTableFromDb);

            DetectionServiceMock.Setup(x => x.FindConnectedCams()).Returns("[HBV HD CAMERA]-[ID:'8&2f223cfb']");
            DetectionServiceMock.SetupAdd(m => m.OnErrorOccurred += e => { });
        }
        public void SmoothGaussValueLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.SmoothGauss))).Returns("5");
            configService.SmoothGaussValue = 1;

            configService.LoadSettings();

            configService.SmoothGaussValue.Should().Be(5);
        }
        public void Cam4YSetupValueLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.Cam4Y))).Returns("575");
            configService.Cam4YSetupValue = 1;

            configService.LoadSettings();

            configService.Cam4YSetupValue.Should().Be(575);
        }
        public void FreeThrowsDoubleScoreWindowHeightLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.FreeThrowsDoubleScoreWindowHeight))).Returns("546.5");
            configService.FreeThrowsDoubleScoreWindowHeight = 1.0;

            configService.LoadSettings();

            configService.FreeThrowsDoubleScoreWindowHeight.Should().Be(546.5);
        }
        public void FreeThrowsSingleScoreWindowPositionTopLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.FreeThrowsSingleScoreWindowPositionTop))).Returns("546.5");
            configService.FreeThrowsSingleScoreWindowPositionTop = 1.0;

            configService.LoadSettings();

            configService.FreeThrowsSingleScoreWindowPositionTop.Should().Be(546.5);
        }
        public void Cam4SetupSectorLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.Cam4SetupSector))).Returns("20/1");
            configService.Cam4SetupSector = "SomeTrash";

            configService.LoadSettings();

            configService.Cam4SetupSector.Should().Be("20/1");
        }
        public void ToCam4DistanceLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.ToCam4Distance))).Returns("35.5");
            configService.ToCam4Distance = 1.0;

            configService.LoadSettings();

            configService.ToCam4Distance.Should().Be(35.5);
        }
        public void Cam4EnabledLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.Cam4CheckBox))).Returns("True");
            configService.Cam4Enabled = false;

            configService.LoadSettings();

            configService.Cam4Enabled.Should().BeTrue();
        }
        public void MainWindowWidthLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.MainWindowWidth))).Returns("356.56");
            configService.MainWindowWidth = 1.0;

            configService.LoadSettings();

            configService.MainWindowWidth.Should().Be(356.56);
        }
        public void MovesDetectedSleepTimeValueLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.MoveDetectedSleepTime))).Returns("0.25");
            configService.MovesDetectedSleepTimeValue = 0.1;

            configService.LoadSettings();

            configService.MovesDetectedSleepTimeValue.Should().Be(0.25);
        }
        public void Cam4IdLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.Cam4Id))).Returns("r4rt54");
            configService.Cam4Id = "SomeTrash";

            configService.LoadSettings();

            configService.Cam4Id.Should().Be("r4rt54");
        }
        public void CamsFovAngleLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.CamFovAngle))).Returns("75.5");
            configService.CamsFovAngle = 1;

            configService.LoadSettings();

            configService.CamsFovAngle.Should().Be(75.5);
        }
        public void MinContourWidthValueLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.MinContourWidth))).Returns("150");
            configService.MinContourWidthValue = 1;

            configService.LoadSettings();

            configService.MinContourWidthValue.Should().Be(150);
        }
        public void Cam3ThresholdSliderValueLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.Cam3ThresholdSlider))).Returns("474.56");
            configService.Cam3ThresholdSliderValue = 1.0;

            configService.LoadSettings();

            configService.Cam3ThresholdSliderValue.Should().Be(474.56);
        }
        public void ClassicScoreWindowWidthLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.ClassicScoreWindowWidth))).Returns("546.5");
            configService.ClassicScoreWindowWidth = 1.0;

            configService.LoadSettings();

            configService.ClassicScoreWindowWidth.Should().Be(546.5);
        }
        public void CamsResolutionHeightLoaded()
        {
            DbServiceMock.Setup(x => x.SettingsGetValue(It.Is <SettingsType>(s => s == SettingsType.ResolutionHeight))).Returns("1920");
            configService.CamsResolutionHeight = 1;

            configService.LoadSettings();

            configService.CamsResolutionHeight.Should().Be(1920);
        }
        public void DbServiceMethodCallsWithFreeThrowsSingleScoreWindowWidth()
        {
            var settingsType = SettingsType.FreeThrowsSingleScoreWindowWidth;
            var value        = 158.26;

            configService.FreeThrowsSingleScoreWindowWidth = value;

            configService.SaveSettings();

            DbServiceMock.Verify(m => m.SettingsSetValue(settingsType,
                                                         Common.Converter.ToString(value)));
        }
        public void DbServiceMethodCallsWithCam2ThresholdSliderValue()
        {
            var settingsType = SettingsType.Cam2ThresholdSlider;
            var value        = 155.25;

            configService.Cam2ThresholdSliderValue = value;

            configService.SaveSettings();

            DbServiceMock.Verify(m => m.SettingsSetValue(settingsType,
                                                         Common.Converter.ToString(value)));
        }
        public void DbServiceMethodCallsWithCam4SetupSector()
        {
            var settingsType = SettingsType.Cam4SetupSector;
            var value        = "20/1";

            configService.Cam4SetupSector = value;

            configService.SaveSettings();

            DbServiceMock.Verify(m => m.SettingsSetValue(settingsType,
                                                         Common.Converter.ToString(value)));
        }
        public void DbServiceMethodCallsWithCam4Enabled()
        {
            var settingsType = SettingsType.Cam4CheckBox;
            var value        = true;

            configService.Cam4Enabled = value;

            configService.SaveSettings();

            DbServiceMock.Verify(m => m.SettingsSetValue(settingsType,
                                                         Common.Converter.ToString(value)));
        }
        public void DbServiceMethodCallsWithToCam4Distance()
        {
            var settingsType = SettingsType.ToCam4Distance;
            var value        = 25.6;

            configService.ToCam4Distance = value;

            configService.SaveSettings();

            DbServiceMock.Verify(m => m.SettingsSetValue(settingsType,
                                                         Common.Converter.ToString(value)));
        }
        public void DbServiceMethodCallsWithCamsDetectionWindowWidth()
        {
            var settingsType = SettingsType.CamsDetectionWindowWidth;
            var value        = 526.25;

            configService.CamsDetectionWindowWidth = value;

            configService.SaveSettings();

            DbServiceMock.Verify(m => m.SettingsSetValue(settingsType,
                                                         Common.Converter.ToString(value)));
        }
        public void DbServiceMethodCallsWithMovesDetectedSleepTimeValue()
        {
            var settingsType = SettingsType.MoveDetectedSleepTime;
            var value        = 0.25;

            configService.MovesDetectedSleepTimeValue = value;

            configService.SaveSettings();

            DbServiceMock.Verify(m => m.SettingsSetValue(settingsType,
                                                         Common.Converter.ToString(value)));
        }
        public void DbServiceMethodCallsWithMainWindowPositionTop()
        {
            var settingsType = SettingsType.MainWindowPositionTop;
            var value        = 567;

            configService.MainWindowPositionTop = value;

            configService.SaveSettings();

            DbServiceMock.Verify(m => m.SettingsSetValue(settingsType,
                                                         Common.Converter.ToString(value)));
        }
        public void DbServiceMethodCallsWithCam3Id()
        {
            var settingsType = SettingsType.Cam3Id;
            var value        = "2323re";

            configService.Cam3Id = value;

            configService.SaveSettings();

            DbServiceMock.Verify(m => m.SettingsSetValue(settingsType,
                                                         Common.Converter.ToString(value)));
        }
        public void DbServiceMethodCallsWithCamsFovAngle()
        {
            var settingsType = SettingsType.CamFovAngle;
            var value        = 75.5;

            configService.CamsFovAngle = value;

            configService.SaveSettings();

            DbServiceMock.Verify(m => m.SettingsSetValue(settingsType,
                                                         Common.Converter.ToString(value)));
        }