Exemplo n.º 1
0
 public MainWindow()
 {
     InitializeComponent();
     this.DataContext = this;
     RfidOption       = new RfidOptions();
     Rfid             = new RfidTool(RfidOption);
     RfidTags         = new Dictionary <string, RfidTagInfo>();
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 public void Put([FromBody] RfidOptions options)
 {
     storageService.SetRfidOptions(options);
 }
Exemplo n.º 6
0
 public void Put([FromBody] RfidOptions options)
 {
     checkpointRepository.SetRfidOptions(options);
 }