尝试测试以下内容
// GET: odata/API_INSTANCE
[EnableQuery]
public SingleResult<API_INSTANCE> GetAPI_INSTANCE([FromODataUri] Guid key)
{
return SingleResult.Create(db.API_FIRM_LINK.Where(m => m.ApiFirmLinkId == key).Select(m => m.API_INSTANCE));
}
这是我到目前为止的内容:不确定如何调用ODATA,GUID KEY。我问了一个与此相关的类似问题
public void GetAPI_INSTANCETest()
{
////Arrange
API_FIRM_LINKController controller = new API_FIRM_LINKController();
////ACT
controller.GetAPI_INSTANCE();
SingleResult result = controller.GetAPI_INSTANCE() as SingleResult;
////Assert
Assert.IsNotNull(result);
Console.Write(result);
}
}