Ejemplo n.º 1
0
        public static AndConstraint <OperationImportSegment> ShouldBeOperationImportSegment(this ODataPathSegment segment, params IEdmOperationImport[] operationImports)
        {
            segment.Should().BeOfType <OperationImportSegment>();
            OperationImportSegment operationImportSegment = segment.As <OperationImportSegment>();

            operationImportSegment.OperationImports.Should().ContainExactly(operationImports);
            return(new AndConstraint <OperationImportSegment>(operationImportSegment));
        }
Ejemplo n.º 2
0
        public static AndConstraint <NavigationPropertySegment> ShouldBeNavigationPropertySegment(this ODataPathSegment segment, IEdmNavigationProperty navigationProperty)
        {
            segment.Should().BeOfType <NavigationPropertySegment>();
            NavigationPropertySegment navPropSegment = segment.As <NavigationPropertySegment>();

            navPropSegment.NavigationProperty.Should().Be(navigationProperty);
            return(new AndConstraint <NavigationPropertySegment>(navPropSegment));
        }
Ejemplo n.º 3
0
        public static AndConstraint <DynamicPathSegment> ShouldBeDynamicPathSegment(this ODataPathSegment segment, string identifier)
        {
            segment.Should().BeOfType <DynamicPathSegment>();
            DynamicPathSegment openPropertySegment = segment.As <DynamicPathSegment>();

            openPropertySegment.Identifier.Should().Be(identifier);
            return(new AndConstraint <DynamicPathSegment>(openPropertySegment));
        }
Ejemplo n.º 4
0
        public static AndConstraint <TypeSegment> ShouldBeTypeSegment(this ODataPathSegment segment, IEdmType type)
        {
            segment.Should().BeOfType <TypeSegment>();
            TypeSegment typeSegment = segment.As <TypeSegment>();

            typeSegment.EdmType.ShouldBeEquivalentTo(type);
            return(new AndConstraint <TypeSegment>(typeSegment));
        }
Ejemplo n.º 5
0
        public static AndConstraint <PropertySegment> ShouldBePropertySegment(this ODataPathSegment segment, IEdmProperty expectedProperty)
        {
            segment.Should().BeOfType <PropertySegment>();
            PropertySegment propertySegment = segment.As <PropertySegment>();

            propertySegment.Property.Should().Be(expectedProperty);
            return(new AndConstraint <PropertySegment>(propertySegment));
        }
Ejemplo n.º 6
0
        public static AndConstraint <SingletonSegment> ShouldBeSingletonSegment(this ODataPathSegment segment, IEdmSingleton singleton)
        {
            segment.Should().BeOfType <SingletonSegment>();
            SingletonSegment singletonSegment = segment.As <SingletonSegment>();

            singletonSegment.Singleton.Should().BeSameAs(singleton);
            return(new AndConstraint <SingletonSegment>(singletonSegment));
        }
Ejemplo n.º 7
0
        public static AndConstraint <KeySegment> ShouldBeKeySegment(this ODataPathSegment segment, params KeyValuePair <string, object>[] keys)
        {
            segment.Should().BeOfType <KeySegment>();
            KeySegment entitySetSegment = segment.As <KeySegment>();

            entitySetSegment.Keys.Should().ContainExactly(keys);
            return(new AndConstraint <KeySegment>(entitySetSegment));
        }
Ejemplo n.º 8
0
        public static AndConstraint <EntitySetSegment> ShouldBeEntitySetSegment(this ODataPathSegment segment, IEdmEntitySet entitySet)
        {
            segment.Should().BeOfType <EntitySetSegment>();
            EntitySetSegment entitySetSegment = segment.As <EntitySetSegment>();

            entitySetSegment.EntitySet.Should().BeSameAs(entitySet);
            return(new AndConstraint <EntitySetSegment>(entitySetSegment));
        }
Ejemplo n.º 9
0
        public static AndConstraint <BatchReferenceSegment> ShouldBeBatchReferenceSegment(this ODataPathSegment segment, IEdmType resultingType)
        {
            segment.Should().BeOfType <BatchReferenceSegment>();
            BatchReferenceSegment batchReferenceSegment = segment.As <BatchReferenceSegment>();

            batchReferenceSegment.EdmType.Should().Be(resultingType);
            return(new AndConstraint <BatchReferenceSegment>(batchReferenceSegment));
        }
Ejemplo n.º 10
0
        public static AndConstraint <AnnotationSegment> ShouldBeAnnotationSegment(this ODataPathSegment segment, IEdmTerm expectedTerm)
        {
            segment.Should().BeOfType <AnnotationSegment>();
            AnnotationSegment annotationSegment = segment.As <AnnotationSegment>();

            annotationSegment.Term.Should().Be(expectedTerm);
            return(new AndConstraint <AnnotationSegment>(annotationSegment));
        }
Ejemplo n.º 11
0
        public static AndConstraint <ReferenceSegment> ShouldBeReferenceSegment(this ODataPathSegment segment, IEdmNavigationSource navigationSource)
        {
            segment.Should().BeOfType <ReferenceSegment>();
            ReferenceSegment referenceSegment = segment.As <ReferenceSegment>();

            referenceSegment.TargetEdmNavigationSource.Should().Be(navigationSource);
            return(new AndConstraint <ReferenceSegment>(referenceSegment));
        }
Ejemplo n.º 12
0
        public static AndConstraint <OpenPropertySegment> ShouldBeOpenPropertySegment(this ODataPathSegment segment, string openPropertyName)
        {
            segment.Should().BeOfType <OpenPropertySegment>();
            OpenPropertySegment openPropertySegment = segment.As <OpenPropertySegment>();

            openPropertySegment.PropertyName.Should().Be(openPropertyName);
            return(new AndConstraint <OpenPropertySegment>(openPropertySegment));
        }
Ejemplo n.º 13
0
        public static AndConstraint <KeySegment> ShouldBeSimpleKeySegment(this ODataPathSegment segment, object value)
        {
            segment.Should().BeOfType <KeySegment>();
            KeySegment entitySetSegment = segment.As <KeySegment>();

            entitySetSegment.Keys.Count().Should().Be(1);
            entitySetSegment.Keys.Single().Value.Should().Be(value);
            return(new AndConstraint <KeySegment>(entitySetSegment));
        }
Ejemplo n.º 14
0
 public static AndConstraint <ValueSegment> ShouldBeValueSegment(this ODataPathSegment segment)
 {
     segment.Should().BeOfType <ValueSegment>();
     return(new AndConstraint <ValueSegment>(segment.As <ValueSegment>()));
 }