Instantiating IOptions<> in xunit
问题 I'm trying to write an xunit test for a class (in a .net Core project) that looks something like: public Class FoodStore:IFoodStore { FoodList foodItems; public FoodStore(IOptions<FoodList> foodItems) { this.foodItems = foodItems; } public bool IsFoodItemPresentInList(string foodItemId) { //Logic to search from Food List } }` Note: FoodList is actually a json file, containing data, that is loaded and configured in the Startup class. How can I write an xunit test with appropriate dependency