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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
public static AndConstraint <ValueSegment> ShouldBeValueSegment(this ODataPathSegment segment) { segment.Should().BeOfType <ValueSegment>(); return(new AndConstraint <ValueSegment>(segment.As <ValueSegment>())); }