コード例 #1
0
        public void AddSocket(Socket socket, IEnumerable <SensorParameter> parameters)
        {
            var parser   = new KeyloggerSettingsParser();
            var settings = parser.ParseSocketSettings(parameters);

            _stateStore.SetSettings(socket, settings);
        }
コード例 #2
0
        public void GetSettings_SetAndGet()
        {
            var socket     = new Socket(1, "Test");
            var settings   = new KeyloggerSocketSettings(TimeSpan.FromSeconds(50));
            var stateStore = new KeyloggerStateStore();

            stateStore.SetSettings(socket, settings);

            Assert.Equal(settings, stateStore.GetSettings(socket));
        }
コード例 #3
0
        public void GetSockets()
        {
            var socket     = new Socket(1, "Test");
            var settings   = new KeyloggerSocketSettings(TimeSpan.FromSeconds(50));
            var stateStore = new KeyloggerStateStore();

            stateStore.SetSettings(socket, settings);

            var sockets = stateStore.GetSockets();

            Assert.Single(sockets);
            Assert.Equal(socket, sockets.First());
        }