Skip to content

Commit

Permalink
work
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvand committed Jul 19, 2024
1 parent 3097e7a commit e5ff909
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Yvand.EntraCP.Tests/FilterUsersBasedOnGroupsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void TestUsers(TestUser user)
[TestCase("testEntraCPUser_020")]
public void DebugTestUser(string upnPrefix)
{
TestUser user = TestEntitySourceManager.GetOneUser(upnPrefix);
TestUser user = TestEntitySourceManager.FindUser(upnPrefix);
base.TestSearchAndValidateForEntraIDUser(user);
}
#endif
Expand All @@ -96,7 +96,7 @@ public override void InitializeSettings()
[TestCase("testEntraCPUser_020")]
public void DebugTestUser(string upnPrefix)
{
TestUser user = TestEntitySourceManager.GetOneUser(upnPrefix);
TestUser user = TestEntitySourceManager.FindUser(upnPrefix);
base.TestSearchAndValidateForEntraIDUser(user);
}

Expand Down
5 changes: 3 additions & 2 deletions Yvand.EntraCP.Tests/UnitTestsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ public static IEnumerable<TestUser> GetSomeUsers(int count)
return TestUsersSource.GetSomeEntities(count, null);
}

public static TestUser GetOneUser(string upnPrefix)
public static TestUser FindUser(string upnPrefix)
{
return TestUsersSource.Entities.First(x => x.UserPrincipalName.StartsWith(upnPrefix)).Clone() as TestUser;
}
Expand All @@ -398,7 +398,8 @@ public static IEnumerable<TestGroup> GetSomeGroups(int count, bool securityEnabl

public static TestGroup GetOneGroup(bool securityEnabledOnly)
{
return TestGroupsSource.Entities.First(x => x.SecurityEnabled == securityEnabledOnly).Clone() as TestGroup;
Func<TestGroup, bool> securityEnabledOnlyFilter = x => x.SecurityEnabled == securityEnabledOnly;
return TestGroupsSource.GetSomeEntities(1, securityEnabledOnlyFilter).First();
}
}
}

0 comments on commit e5ff909

Please sign in to comment.