Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void queryByUserIncludingGroups()
        public virtual void queryByUserIncludingGroups()
        {
            TenantQuery query = identityService.createTenantQuery().userMember(USER);

            assertThat(query.includingGroupsOfUser(false).count(), @is(1L));
            assertThat(query.includingGroupsOfUser(true).count(), @is(2L));
        }
Ejemplo n.º 2
0
        protected internal virtual IList <string> setupTenantQueryMock(IList <Tenant> tenants)
        {
            TenantQuery mockTenantQuery = mock(typeof(TenantQuery));

            when(identityServiceMock.createTenantQuery()).thenReturn(mockTenantQuery);
            when(mockTenantQuery.userMember(anyString())).thenReturn(mockTenantQuery);
            when(mockTenantQuery.includingGroupsOfUser(anyBoolean())).thenReturn(mockTenantQuery);
            when(mockTenantQuery.list()).thenReturn(tenants);

            IList <string> tenantIds = new List <string>();

            foreach (Tenant tenant in tenants)
            {
                tenantIds.Add(tenant.Id);
            }
            return(tenantIds);
        }