public void GetRelationshipType_Order_Customer_Should_Return_OneToMany()
        {
            // Arrange
            var         context = _fixture.GetContext();
            var         order   = new MockNorthwind().Orders[0];
            INavigation nav     = context.Entry(order).Navigation(nameof(order.Customer)).Metadata;

            // Act
            RelationshipType?relType = nav.GetRelationshipType();

            // Assert
            Assert.Equal(RelationshipType.OneToMany, relType);
        }
예제 #2
0
        private void EnsureSeedData()
        {
            // Test Customers
            var context = _fixture.GetContext();

            EnsureTestCustomer(context, TestCustomerId1, TestTerritoryId1);
            EnsureTestCustomer(context, TestCustomerId2, TestTerritoryId2);

            // Test Customer Settings
            EnsureTestCustomerSetting(context, TestCustomerId1);
            EnsureTestCustomerSetting(context, TestCustomerId2);

            // Test Territories
            EnsureTestTerritory(context, TestTerritoryId1);
            EnsureTestTerritory(context, TestTerritoryId2);
            EnsureTestTerritory(context, TestTerritoryId3);

            // Test Product Infos
            EnsureTestProductInfo(context, ProductInfo1A, ProductInfo1B);
            EnsureTestProductInfo(context, ProductInfo2A, ProductInfo2B);

            // Save changes
            context.SaveChanges();
        }