public void BoundCsdlSemanticsOperationPropertiesShouldBeCorrect()
        {
            var action = new CsdlAction(
                "Checkout",
                new CsdlOperationParameter[] { new CsdlOperationParameter("entity", new CsdlNamedTypeReference("FQ.NS.EntityType", false, testLocation), null, testLocation) }, 
                new CsdlNamedTypeReference("Edm.String", false, testLocation), 
                true /*isBound*/, 
                "entity/FakePath", 
                null /*documentation*/, 
                testLocation);

            var semanticAction = new CsdlSemanticsAction(this.semanticSchema, action);
            semanticAction.IsBound.Should().BeTrue();
            semanticAction.Location().Should().Be(testLocation);
            semanticAction.Name.Should().Be("Checkout");
            semanticAction.Namespace.Should().Be("FQ.NS");
            semanticAction.ReturnType.Definition.Should().Be(EdmCoreModel.Instance.GetString(true).Definition);
            semanticAction.EntitySetPath.Path.ToList()[0].Should().Be("entity");
            semanticAction.EntitySetPath.Path.ToList()[1].Should().Be("FakePath");
            semanticAction.SchemaElementKind.Should().Be(EdmSchemaElementKind.Action);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CsdlSemanticsAction"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="action">The action.</param>
 public CsdlSemanticsAction(CsdlSemanticsSchema context, CsdlAction action)
     : base(context, action)
 {
 }
        public void TryGetEntitySetWithBoundCsdlSemanticOperationParameterShouldReturnTrueAndHaveNoErrors()
        {
            var csdlEntityType = new CsdlEntityType("EntityType", null, false, false, false, null, Enumerable.Empty<CsdlProperty>(), Enumerable.Empty<CsdlNavigationProperty>(), null, null);
            var csdlSchema = CsdlBuilder.Schema("FQ.NS", csdlStructuredTypes: new[] { csdlEntityType });

            var csdlModel = new CsdlModel();
            csdlModel.AddSchema(csdlSchema);
            var semanticModel = new CsdlSemanticsModel(csdlModel, new EdmDirectValueAnnotationsManager(), Enumerable.Empty<IEdmModel>());
            var semanticSchema = new CsdlSemanticsSchema(semanticModel, csdlSchema);
            var testLocation = new CsdlLocation(1, 3);

            var action = new CsdlAction(
                "Checkout",
                new CsdlOperationParameter[] { new CsdlOperationParameter("entity", new CsdlNamedTypeReference("FQ.NS.EntityType", false, testLocation), null, testLocation) },
                new CsdlNamedTypeReference("Edm.String", false, testLocation),
                true /*isBound*/,
                "entity",
                null /*documentation*/,
                testLocation);

            var semanticAction = new CsdlSemanticsAction(semanticSchema, action);
            IEdmOperationParameter edmParameter;
            IEnumerable<IEdmNavigationProperty> navigationProperties;
            IEdmEntityType entityType;
            IEnumerable<EdmError> errors;
            semanticAction.TryGetRelativeEntitySetPath(semanticSchema.Model, out edmParameter, out navigationProperties, out entityType, out errors).Should().BeTrue();
            edmParameter.Name.Should().Be("entity");
            navigationProperties.Should().BeEmpty();
            entityType.FullName().Should().Be("FQ.NS.EntityType");
            errors.Should().BeEmpty();
        }