public void AddSocket(Socket socket, IEnumerable <SensorParameter> parameters) { var parser = new KeyloggerSettingsParser(); var settings = parser.ParseSocketSettings(parameters); _stateStore.SetSettings(socket, settings); }
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)); }
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()); }