public void cannot_use_factory_if_is_not_initialised()
        {
            PiTop4Board.Configure(new DummyGpioController());
            using var module = PiTop4Board.Instance;
            var action = new Action(() =>
                                    module.GetOrCreateCamera <FileSystemCamera>(new DirectoryInfo(Path.GetTempPath()))
                                    );

            action.Should().Throw <InvalidOperationException>()
            .Which
            .Message
            .Should()
            .Match("Cannot find a factory if type PiTop.Abstractions.IConnectedDeviceFactory<PiTop.Camera.FileSystemCameraSettings, PiTop.Camera.FileSystemCamera>, make sure to configure the module calling UseCamera first.");
        }
Exemplo n.º 2
0
 public MmkPlateTests()
 {
     PiTop4Board.Configure(new DummyGpioController(), i2cDeviceFactory: settings => new DummyI2CDevice(settings));
     _module = PiTop4Board.Instance;
 }
Exemplo n.º 3
0
 public FileSystemCameraTests()
 {
     PiTop4Board.Configure(new DummyGpioController());
     _module = PiTop4Board.Instance;
 }
Exemplo n.º 4
0
 public FoundationPlateTests()
 {
     PiTop4Board.Configure(new DummyGpioController());
     _module = PiTop4Board.Instance;
 }