Quantcast
Channel: James's Programming Page
Viewing all articles
Browse latest Browse all 141

HidSharp mocking

$
0
0

Hi,

Thanks for the great HidSharp library, I find it very useful. I am using it in one C# project to communicate with a specific device and want to be able to write unit tests for it. Unfortunately, the library currently makes use of concrete types with no interfaces. This makes it hard to mock/fake for testing.

Is there any chance an `IHidDevice` interface could be added to the NuGet package please? I would be happy to contribute it myself, if you are accepting outside contributions and can tell me how best to share my code with you, as it isn't hosted on GitHub.

I envisage something like this:

```
public interface IHidDevice
{
    Stream Open();
    int ProductID { get; }
    int VendorID { get; }
}
```


Viewing all articles
Browse latest Browse all 141

Trending Articles