I’ve recently installed the Facebook C# SDK using NuGet and am wondering why the types don’t have associated interfaces.
What I’d like to do is inject the types from the SDK into my application however at the moment I’m not sure if I’ve either missed something or the SDK just doesn’t contain any interfaces other than IFacebookApplication.
How is everyone else unit testing their code whilst using this SDK? Should I be downloading and implimenting the interfaces myself rather than using the NuGet installer?
We don’t use interfaces with the Facebook C# SDK. Our goal with the SDK is to keep it as simple as possible. I would actually just suggest you implement your own repository objects that utilize the FacebookClient object rather than injecting the FacebookClient object into your objects if you want to use interfaces.
The other option is to mock the FacebookClient. We use Moq for this in our test, but any mocking library should work.