Skip to content

Commit

Permalink
Obsolete test instead of removing it
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrawehr committed Nov 7, 2024
1 parent 501612f commit ca32453
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/System.Device.Gpio.Tests/GpioControllerSoftwareTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,22 @@ public void UsingLogicalNumberingDisposesTheRightPin()
ctrl.Dispose();
}

[Fact]
[Obsolete("Tests obsolete features")]
public void UsingBoardNumberingDisposesTheRightPin()
{
// Our mock driver maps physical pin 2 to logical pin 1
_mockedGpioDriver.Setup(x => x.ConvertPinNumberToLogicalNumberingSchemeEx(2)).Returns(1);
_mockedGpioDriver.Setup(x => x.OpenPinEx(1));
_mockedGpioDriver.Setup(x => x.SetPinModeEx(1, PinMode.Output));
_mockedGpioDriver.Setup(x => x.ClosePinEx(1));
_mockedGpioDriver.Setup(x => x.IsPinModeSupportedEx(1, PinMode.Output)).Returns(true);
var ctrl = new GpioController(PinNumberingScheme.Board, _mockedGpioDriver.Object);
ctrl.OpenPin(2, PinMode.Output);
// No close on the pin here, we want to check that the Controller's Dispose works correctly
ctrl.Dispose();
}

[Fact]
public void CallbackOnEventWorks()
{
Expand Down

0 comments on commit ca32453

Please sign in to comment.