public void Can_mark_type_as_owned_type()
        {
            var model        = new Model();
            var modelBuilder = CreateModelBuilder(model);

            var entityBuilder = modelBuilder.Entity(typeof(Customer), ConfigurationSource.Explicit);

            Assert.NotNull(modelBuilder.Entity(typeof(Details), ConfigurationSource.Convention));

            Assert.False(model.IsOwned(typeof(Details)));

            Assert.NotNull(entityBuilder.HasOwnership(typeof(Details), nameof(Customer.Details), ConfigurationSource.Convention));

            Assert.NotNull(modelBuilder.Ignore(typeof(Details), ConfigurationSource.Convention));

            Assert.Empty(model.FindEntityTypes(typeof(Details)));

            Assert.Null(entityBuilder.HasOwnership(typeof(Details), nameof(Customer.Details), ConfigurationSource.Convention));

            Assert.Null(modelBuilder.Owned(typeof(Details), ConfigurationSource.Convention));

            Assert.NotNull(entityBuilder.HasOwnership(typeof(Details), nameof(Customer.Details), ConfigurationSource.DataAnnotation));

            Assert.NotNull(modelBuilder.Owned(typeof(Details), ConfigurationSource.Convention));

            Assert.NotNull(modelBuilder.Owned(typeof(Details), ConfigurationSource.DataAnnotation));

            Assert.True(model.IsOwned(typeof(Details)));

            Assert.NotNull(
                modelBuilder.Entity(typeof(Product), ConfigurationSource.Explicit)
                .HasOwnership(typeof(Details), nameof(Product.Details), ConfigurationSource.Convention));

            Assert.Null(modelBuilder.Ignore(typeof(Details), ConfigurationSource.Convention));

            Assert.Equal(2, model.FindEntityTypes(typeof(Details)).Count());

            Assert.Equal(
                CoreStrings.ClashingSharedType(typeof(Details).Name),
                Assert.Throws <InvalidOperationException>(() => modelBuilder.Entity(typeof(Details), ConfigurationSource.Explicit)).Message);

            Assert.Equal(
                CoreStrings.ClashingOwnedEntityType(typeof(Details).Name),
                Assert.Throws <InvalidOperationException>(()
                                                          => modelBuilder.SharedTypeEntity(nameof(Details), typeof(Details), ConfigurationSource.Explicit)).Message);

            Assert.NotNull(modelBuilder.Ignore(typeof(Details), ConfigurationSource.Explicit));

            Assert.False(model.IsOwned(typeof(Details)));

            Assert.NotNull(modelBuilder.SharedTypeEntity(nameof(Details), typeof(Details), ConfigurationSource.Explicit));

            Assert.Empty(model.FindEntityTypes(typeof(Details)).Where(e => !e.HasSharedClrType));

            Assert.Null(modelBuilder.Owned(typeof(Details), ConfigurationSource.Convention));

            Assert.Equal(
                CoreStrings.ClashingNonOwnedEntityType(typeof(Details).Name),
                Assert.Throws <InvalidOperationException>(() => modelBuilder.Owned(typeof(Details), ConfigurationSource.Explicit)).Message);
        }