public MainWindow() { InitializeComponent(); this.DataContext = this; RfidOption = new RfidOptions(); Rfid = new RfidTool(RfidOption); RfidTags = new Dictionary <string, RfidTagInfo>(); }
public void Should_return_initial_rfid_options() { var opts = new RfidOptions(); using var storageService = new StorageService(Options .Create(new ServiceOptions { StorageConnectionString = storageConnectionString, InitialRfidOptions = opts }), MessageHub, SystemClock); var settings = storageService.GetRfidOptions(); settings.Should().BeSameAs(opts); }
public async Task Should_set_rfid_options() { var opts = new RfidOptions { Enabled = true, ConnectionString = "bbb", RpsThreshold = 666, CheckpointAggregationWindowMs = 777 }; using var svc = CreateCheckpointService(); var client = new CheckpointServiceClient(svc.ListenUri); await client.SetRfidOptions(opts); var opts2 = await client.GetRfidOptions(); opts2.Enabled.Should().Be(true); opts2.ConnectionString.Should().Be("bbb"); opts2.RpsThreshold.Should().Be(666); opts2.CheckpointAggregationWindowMs.Should().Be(777); }
public async Task Should_set_rfid_options() { var opts = new RfidOptions { Enabled = true, ConnectionString = "bbb", RpsThreshold = 666, CheckpointAggregationWindowMs = 777 }; using var svc = CreateCheckpointService(); var client = new HttpClient(); (await client.PutAsync($"{svc.ListenUri}/options", new StringContent(JsonConvert.SerializeObject(opts), Encoding.UTF8, "application/json"))) .EnsureSuccessStatusCode(); var opts2 = await client.GetAsync <RfidOptions>($"{svc.ListenUri}/options"); opts2.Enabled.Should().Be(true); opts2.ConnectionString.Should().Be("bbb"); opts2.RpsThreshold.Should().Be(666); opts2.CheckpointAggregationWindowMs.Should().Be(777); }
public void Put([FromBody] RfidOptions options) { storageService.SetRfidOptions(options); }
public void Put([FromBody] RfidOptions options) { checkpointRepository.SetRfidOptions(options); }