testing library

Test doubles for applications using bacnet_plugin.

FakeBacnetClient implements BacnetClient with in-memory FakeBacnetDevices, so code using the client, DeviceScanner or PropertyMonitor can be unit tested without a network or the native stack.

import 'package:bacnet_plugin/bacnet_plugin.dart';
import 'package:bacnet_plugin/testing.dart';

final client = FakeBacnetClient(devices: [
  FakeBacnetDevice(1234)
    ..addObject(BacnetObjectType.analogInput, 1,
        presentValue: const BacnetReal(21.5)),
]);

Classes

FakeBacnetClient
A BacnetClient backed by in-memory FakeBacnetDevices, for testing applications without a network or the native stack.
FakeBacnetDevice
An in-memory BACnet device for FakeBacnetClient.
FakeBacnetObject
An object of a FakeBacnetDevice.
FakeBacnetRequest
A request received by a FakeBacnetClient, for assertions in tests.
FakeBacnetRouter
A router simulated by a FakeBacnetClient: answers Who-Is-Router-To-Network with the networks it reaches and routing table queries with routingTable.