public void GetSettings_DefaultValue()
        {
            var socket          = new Socket(1, "Test");
            var defaultSettings = KeyloggerSocketSettings.GetDefault();
            var stateStore      = new KeyloggerStateStore();

            Assert.Equal(defaultSettings, stateStore.GetSettings(socket));
        }
        public void Parse_OffDelayNotDefined()
        {
            var defaultSettings = KeyloggerSocketSettings.GetDefault();
            var parser          = new KeyloggerSettingsParser();
            var result          = parser.ParseSocketSettings(new List <SensorParameter>());

            Assert.Equal(defaultSettings.OffDelay, result.OffDelay);
        }
        public void Parse_OffDelayInvalidValue()
        {
            var defaultSettings = KeyloggerSocketSettings.GetDefault();
            var parser          = new KeyloggerSettingsParser();
            var result          = parser.ParseSocketSettings(new List <SensorParameter>()
            {
                new SensorParameter("OffDelaySeconds", "-1")
            });

            Assert.Equal(defaultSettings.OffDelay, result.OffDelay);
        }
        public void Parse_OffDelayMultipleDefined()
        {
            var defaultSettings = KeyloggerSocketSettings.GetDefault();
            var parser          = new KeyloggerSettingsParser();
            var result          = parser.ParseSocketSettings(new List <SensorParameter>()
            {
                new SensorParameter("OffDelaySeconds", "60"),
                new SensorParameter("OffDelaySeconds", "90")
            });

            Assert.Equal(defaultSettings.OffDelay, result.OffDelay);
        }