Esempio n. 1
0
        public void PropertyAttributeDictionary_GetRelatedEntityProperties_TwoAttributesExists_OneWithAlias_Test()
        {
            // Arrange
            // Act
            var actual = new PropertyAttributeDictionary().GetRelatedEntityProperties(typeof(EntityWithDuplicateRelatedEntityOneAlias).GetProperty("Entity3Id"));

            // Assert
            Assert.AreEqual(1, actual.Count());
            Assert.AreEqual("E3", actual.First().Key);
            Assert.AreEqual(typeof(CsdlNavigationProperty), actual.FirstOrDefault().Value.GetType());
        }
Esempio n. 2
0
        public void PropertyAttributeDictionary_GetRelatedEntityProperties_EntityWithNullables_Test()
        {
            // Arrange
            // Act
            var actual = new PropertyAttributeDictionary().GetRelatedEntityProperties(typeof(EntityWithNullables).GetProperty(nameof(EntityWithNullables.Entity1Id)));

            // Assert
            Assert.AreEqual(1, actual.Count());
            Assert.AreEqual(nameof(Entity1), actual.First().Key);
            Assert.AreEqual(typeof(CsdlNavigationProperty), actual.FirstOrDefault().Value.GetType());
            Assert.IsTrue(((CsdlNavigationProperty)actual.FirstOrDefault().Value).Nullable);
        }