internal static SelectedPropertiesNode IncludeEntireSubtree(this SelectedPropertiesNode node, IEdmEntityType entityType)
        {
            var expected = entityType.StructuralProperties().Where(p => p.Type.IsStream());
            var edmStructuralProperties = node.GetSelectedStreamProperties(entityType).Values;

            Assert.Equal(expected.Count(), edmStructuralProperties.Count);
            foreach (var prop in edmStructuralProperties)
            {
                Assert.Contains(prop, expected);
            }

            var navExpected      = entityType.NavigationProperties();
            var edmNavProperties = node.GetSelectedNavigationProperties(entityType);

            Assert.Equal(navExpected.Count(), edmNavProperties.Count());
            foreach (var prop in edmNavProperties)
            {
                Assert.Contains(prop, navExpected);
            }

            foreach (var navigation in entityType.NavigationProperties())
            {
                node.GetSelectedPropertiesForNavigationProperty(entityType, navigation.Name).HaveEntireSubtree();
            }

            return(node);
        }
        internal static SelectedPropertiesNode HaveStreams(this SelectedPropertiesNode node, IEdmEntityType entityType, params string[] streamPropertyNames)
        {
            var keys = node.GetSelectedStreamProperties(entityType).Keys;

            Assert.Equal(keys.Count(), streamPropertyNames.Length);
            foreach (var keyStr in keys)
            {
                Assert.Contains(keyStr, streamPropertyNames);
            }
            return(node);
        }
示例#3
0
 public void GetSelectedStreamPropertiesShouldAlwaysReturnEmptyEnumerationWhenEntityTypeIsNull()
 {
     EntireSubtreeNode.GetSelectedStreamProperties(null).Should().BeEmpty();
     EmptyNode.GetSelectedStreamProperties(null).Should().BeEmpty();
     SelectedPropertiesNode.Create("bar").GetSelectedStreamProperties(null).Should().BeEmpty();
 }
 internal static SelectedPropertiesNode NotHaveStreams(this SelectedPropertiesNode node, IEdmEntityType entityType)
 {
     Assert.Empty(node.GetSelectedStreamProperties(entityType).Keys);
     return(node);
 }
 public void GetSelectedStreamPropertiesShouldAlwaysReturnEmptyEnumerationWhenEntityTypeIsNull()
 {
     Assert.Empty(EntireSubtreeNode.GetSelectedStreamProperties(null));
     Assert.Empty(EmptyNode.GetSelectedStreamProperties(null));
     Assert.Empty(SelectedPropertiesNode.Create("bar").GetSelectedStreamProperties(null));
 }