public void EnforceMultiTenantRequiresTenantId()
        {
            var entryContainer = new EntityEntryContainer();
            var entity         = new EntityEntryContainerTenantModel
            {
                TenantId = TestConfiguration.GetTenantId(),
                Title    = "EntityEntryContainerTests.EnforceMultiTenantRequiresTenantId"
            };

            entryContainer.SetEntityState(entity, EntityEntryState.Added);

            Assert.ThrowsException <MultiTenantException>(() => entryContainer.EnforceMultiTenant(null));
            Assert.ThrowsException <MultiTenantException>(() => entryContainer.EnforceMultiTenant(" "));
        }
        public void EnforceMultiTenantsSkipsNonTenantModels()
        {
            var entryContainer = new EntityEntryContainer();

            var entity = new EntityEntryContainerModel
            {
                Title = "EntityEntryContainerTests.RequireTenantIdForTenantModels"
            };

            entryContainer.SetEntityState(entity, EntityEntryState.Added);

            var entity2 = new EntityEntryContainerTenantModel
            {
                TenantId = TestConfiguration.GetTenantId(),
                Title    = "EntityEntryContainerTests.RequireTenantIdForTenantModels"
            };

            entryContainer.SetEntityState(entity2, EntityEntryState.Added);

            entryContainer.EnforceMultiTenant(TestConfiguration.GetTenantId());

            Assert.AreEqual(entryContainer.Entries().Count(), 2);
        }