Skip to content

Commit 266e11f

Browse files
Merge pull request #47 from microsoftgraph/reproIssue41
Test for issue #41. Latest API is working as expected.
2 parents 32246f4 + 63a6073 commit 266e11f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/Microsoft.Graph.Test/Requests/Functional/UsersTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,25 @@ namespace Microsoft.Graph.Test.Requests.Functional
1313
[TestClass]
1414
public class UsersTests : GraphTestBase
1515
{
16+
// Filter on displayname
17+
// https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/41
18+
[TestMethod]
19+
public async Task UserFilterStartsWith()
20+
{
21+
try
22+
{
23+
var usersQuery = await graphClient.Users.Request().Filter("startswith(displayName,'A')").GetAsync();
24+
foreach (User u in usersQuery)
25+
{
26+
StringAssert.StartsWith(u.DisplayName, "A", "Expected a display name that started with the letter A.");
27+
}
28+
}
29+
catch (Microsoft.Graph.ServiceException e)
30+
{
31+
Assert.Fail("Something happened, check out a trace. Error code: {0}", e.Error.Code);
32+
}
33+
}
34+
1635
// Get the test user's photo.
1736
[TestMethod]
1837
public async Task UserGetPhoto()

0 commit comments

Comments
 (0)