public void Use_of_custom_IForeignKey_throws() { var foreignKey = new FakeForeignKey(); Assert.Equal( CoreStrings.CustomMetadata(nameof(Use_of_custom_IForeignKey_throws), nameof(IForeignKey), nameof(FakeForeignKey)), Assert.Throws <NotSupportedException>(() => foreignKey.AsForeignKey()).Message); }
public void Navigation_is_returned_if_it_implements_IClrCollectionAccessor() { var navigation = new FakeNavigation(); var fk = new FakeForeignKey { PrincipalToDependent = navigation }; navigation.ForeignKey = fk; navigation.PropertyInfo = MyEntity.AsICollectionProperty; Assert.Same(navigation, new ClrCollectionAccessorFactory().Create(navigation)); }