public void PropertyAttributeDictionary_GetRelatedEntityProperties_AttributeExistsWithAlias_Test() { // Arrange // Act var actual = new PropertyAttributeDictionary().GetRelatedEntityProperties(typeof(EntityWithRelatedEntityAlias).GetProperty("Entity3Id")); // Assert Assert.AreEqual("E3", actual.First().Key); Assert.AreEqual(typeof(CsdlNavigationProperty), actual.First().Value.GetType()); }
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()); }
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); }