public void ReturnTypeForNonMultiTenantDbContext() { var factory = new MultiTenantModelCacheKeyFactory(); var dbContext = new TestDbContext(); var key = factory.Create(dbContext); Assert.Equal(typeof(TestDbContext), key); }
public void ReturnTypePlusTenantIdForMultiTenantIdentityDbContext_TUser_TRole_String() { var factory = new MultiTenantModelCacheKeyFactory(); var dbContext = new TestIdentityDbContext_TUser_TRole_String( new TenantInfo("test", null, null, null, null), new DbContextOptions <TestIdentityDbContext_TUser_TRole_String>()); dynamic key = factory.Create(dbContext); Assert.IsType <(Type, string)>(key); Assert.Equal(typeof(TestIdentityDbContext_TUser_TRole_String), key.Item1); Assert.Equal("test", key.Item2); }