Wrapping an API to support dependency injection
问题 I am interacting with an API that just has static functions, and cannot be opened up and changed. public class WindowsNativeGraphAPI { public static IEnumerable<IGraphData> GetGraphData(); public static bool DeleteGraphData(IGraphData data); } I would like to be able to pass the API into a function or constructor and comply with dependency injection (just in case we were to swap out the API later). public void GatherGraphData(IGraphAPI api) {...} To allow this API to be passed in as a