public void GetNavigationSource_Returns_ActionTargetEntitySet_EntitySetPathExpression() { // Arrange IEdmModel model = GetEdmModel(); IEdmAction action = model.SchemaElements.OfType <IEdmAction>().First(c => c.Name == "GetMyOrders1"); IEdmEntitySet previouseEntitySet = model.EntityContainer.FindEntitySet("MyCustomers"); IEdmEntitySet expectedEntitySet = model.EntityContainer.FindEntitySet("MyOrders"); // Act BoundActionPathSegment segment = new BoundActionPathSegment(action, model); // Assert Assert.Same(expectedEntitySet, segment.GetNavigationSource(previouseEntitySet)); }
public void GetNavigationSource_Returns_ActionTargetEntitySet() { // Arrange Mock <IEdmEntitySet> targetEntitySet = new Mock <IEdmEntitySet>(); Mock <IEdmAction> edmAction = new Mock <IEdmAction>(); edmAction.Setup(a => a.Namespace).Returns("NS"); edmAction.Setup(a => a.Name).Returns("SomeAction"); // Act BoundActionPathSegment segment = new BoundActionPathSegment(edmAction.Object); // Assert Assert.Same(targetEntitySet.Object, segment.GetNavigationSource(targetEntitySet.Object)); }
public void GetNavigationSource_Returns_ActionTargetEntitySet() { // Arrange Mock<IEdmEntitySet> targetEntitySet = new Mock<IEdmEntitySet>(); Mock<IEdmAction> edmAction = new Mock<IEdmAction>(); edmAction.Setup(a => a.Namespace).Returns("NS"); edmAction.Setup(a => a.Name).Returns("SomeAction"); // Act BoundActionPathSegment segment = new BoundActionPathSegment(edmAction.Object); // Assert Assert.Same(targetEntitySet.Object, segment.GetNavigationSource(targetEntitySet.Object)); }
public void GetNavigationSource_Returns_ActionTargetEntitySet_EntitySetPathExpression() { // Arrange IEdmModel model = GetEdmModel(); IEdmAction action = model.SchemaElements.OfType<IEdmAction>().First(c => c.Name == "GetMyOrders1"); IEdmEntitySet previouseEntitySet = model.EntityContainer.FindEntitySet("MyCustomers"); IEdmEntitySet expectedEntitySet = model.EntityContainer.FindEntitySet("MyOrders"); // Act BoundActionPathSegment segment = new BoundActionPathSegment(action, model); // Assert Assert.Same(expectedEntitySet, segment.GetNavigationSource(previouseEntitySet)); }