public void GetItemExpandTypeRouting() { var result = ActionSelectorValidator.GetTargetAction(new HttpMethod("GET"), $"{nameof(MockContext.Items)}(1)?$expand=Type"); Assert.AreEqual("Get", result.ActionName); Assert.AreEqual($"{nameof(MockContext.Items)}", result.ControllerDescriptor.ControllerName); Assert.IsTrue(result.ReturnType == typeof(IQueryable <Item>)); }
public void GetManyItemsByNavigationProperty() { var result = ActionSelectorValidator.GetTargetAction(new HttpMethod("GET"), $"{nameof(MockContext.Types)}(1)/Items"); Assert.AreEqual("GetRelatedEntities", result.ActionName); Assert.AreEqual($"{nameof(MockContext.Types)}", result.ControllerDescriptor.ControllerName); Assert.IsTrue(result.ReturnType == typeof(IQueryable <Item>)); }
public void GetTypeByNavigationProperty() { var result = ActionSelectorValidator.GetTargetAction(new HttpMethod("GET"), $"{nameof(MockContext.Items)}(1)/Type"); Assert.AreEqual("GetRelatedEntity", result.ActionName); Assert.AreEqual($"{nameof(MockContext.Items)}", result.ControllerDescriptor.ControllerName); Assert.IsTrue(result.ReturnType == typeof(SingleResult <ItemType>)); }
public void GetAllTypesRoute() { var result = ActionSelectorValidator.GetTargetAction(new HttpMethod("GET"), nameof(MockContext.Types)); Assert.AreEqual("Get", result.ActionName); Assert.AreEqual($"{nameof(MockContext.Types)}", result.ControllerDescriptor.ControllerName); Assert.IsTrue(result.ReturnType == typeof(IQueryable <ItemType>)); }