public void Resolves_OneToMany_WithAttributes() { // Arrange var resolver = new DefaultForeignKeyPropertyResolver(); // Act var fk = resolver.Resolve(typeof(ProductDto), typeof(ProductOptionDto), out var fkRelation); // Assert Assert.Equal(typeof(ProductOptionDto).GetProperty(nameof(ProductOptionDto.ProductId)), fk.PropertyInfo); Assert.Equal(ForeignKeyRelation.OneToMany, fkRelation); }
public void Resolves_OneToOne_WithDefaultConvetions() { // Arrange var resolver = new DefaultForeignKeyPropertyResolver(); // Act var fk = resolver.Resolve(typeof(Product), typeof(Category), out var fkRelation); // Assert Assert.Equal(typeof(Product).GetProperty(nameof(Product.CategoryId)), fk.PropertyInfo); Assert.Equal(ForeignKeyRelation.OneToOne, fkRelation); }