Exemple #1
0
        public void FindCustomers_MultipleTenants()
        {
            // assemble
            var firstTenant  = TenantTestHelper.CreateAnonymousTenantId();
            var secondTenant = TenantTestHelper.CreateAnonymousTenantId();

            TenantContext.SetTenant(firstTenant);
            var firstTenantCustomer = CustomerTestHelper.CreateAnonymousCustomer();

            TenantContext.SetTenant(secondTenant);
            var secondTenantCustomer = CustomerTestHelper.CreateAnonymousCustomer();


            // act
            List <CustomerViewModel> customers = DomainFacade.FindCustomers();

            // assert
            customers.Should().NotBeEmpty().And.Contain(x => x.Name.Equals(secondTenantCustomer.Name));
        }
Exemple #2
0
 public void SetUp()
 {
     TenantContext.SetTenant(TenantTestHelper.CreateAnonymousTenantId());
     EFMultiTenantTestFixture.Database.SetUp();
 }