public async Task ScanAsync()
 {
     var scanner = new DeviceScannerMock("73500000", "gtin8");
     ScannerManager.Current.RegisterDeviceScanner(scanner);
     var result = await ScannerManager.Current.ScanAsync();
     Assert.Equal("73500000", result.Barcode.Scanned);
     Assert.Equal("gtin8", result.Barcode.Type);
 }
 public async Task ScanAsync_Cancelleation()
 {
     var cts = new CancellationTokenSource();
     cts.CancelAfter(100);
     var scanner = new DeviceScannerMock("73500000", "gtin8", 1000);
     ScannerManager.Current.RegisterDeviceScanner(scanner);
     await Assert.ThrowsAnyAsync<OperationCanceledException>(async () => await ScannerManager.Current.ScanAsync(cts.Token));
 }
 public void Scan()
 {
     var scanner = new DeviceScannerMock("73500000", "gtin8");
     ScannerManager.Current.RegisterDeviceScanner(scanner);
     ScannerManager.Current.OnScanned += (sender, args) =>
     {
         Assert.Equal("73500000", args.Result.Barcode.Scanned);
         Assert.Equal("gtin8", args.Result.Barcode.Type);
     };
     ScannerManager.Current.Scan();
 }