public void GetGroupUsers_InputInDifferentCasing_ReturnsCorrectResult() { TestGroupsDataSet testGroupsDataSet = new TestGroupsDataSet(TestResourceName); if (!testGroupsDataSet.Load(GetCorrectData())) { Assert.True(false, GetDataSetLoadingErrors(testGroupsDataSet)); } Assert.True(testGroupsDataSet.GetGroupUsers("AutomatION").Count() == 2, "Expected GetGroupUsers search to be case insensitive"); }
public void Load_ValidTestGroupsXml_LoadsUserGroups() { TestGroupsDataSet testGroupsDataSet = new TestGroupsDataSet(TestResourceName); if (!testGroupsDataSet.Load(GetCorrectData())) { Assert.Empty(GetDataSetLoadingErrors(testGroupsDataSet)); } //Expecting correct groups returned for emails Assert.True(testGroupsDataSet.GetUserGroups("*****@*****.**").Count() == 3, "Expected 3 groups for [email protected]"); Assert.True(testGroupsDataSet.GetUserGroups("*****@*****.**").Contains("Test"), "Expected groups for [email protected] to contain Test"); Assert.True(testGroupsDataSet.GetUserGroups("*****@*****.**").Contains("Automation"), "Expected groups for [email protected] to contain Automation"); Assert.True(testGroupsDataSet.GetUserGroups("*****@*****.**").Contains("all"), "Expected groups for [email protected] to contain group 'all'"); Assert.True(testGroupsDataSet.GetUserGroups("*****@*****.**").Count() == 2, "Expected 2 groups for [email protected]"); Assert.True(testGroupsDataSet.GetUserGroups("*****@*****.**").Contains("Test"), "Expected groups for [email protected] to contain Test"); Assert.True(testGroupsDataSet.GetUserGroups("*****@*****.**").Contains("all"), "Expected groups for [email protected] to contain group 'all'"); Assert.True(testGroupsDataSet.GetUserGroups("*****@*****.**").Count() == 2, "Expected 2 groups for [email protected]"); Assert.True(testGroupsDataSet.GetUserGroups("*****@*****.**").Contains("Automation"), "Expected groups for [email protected] to contain Automation"); Assert.True(testGroupsDataSet.GetUserGroups("*****@*****.**").Contains("all"), "Expected groups for [email protected] to contain group 'all'"); //Expecting correct users returned for groups Assert.True(testGroupsDataSet.GetGroupUsers("Test").Count() == 4, "Expected 4 users for Test group"); Assert.True(testGroupsDataSet.GetGroupUsers("Test").Contains("*****@*****.**", StringComparer.OrdinalIgnoreCase), "Expected [email protected] to be in Test"); Assert.True(testGroupsDataSet.GetGroupUsers("Test").Contains("*****@*****.**", StringComparer.OrdinalIgnoreCase), "Expected [email protected] to be in Test"); Assert.True(testGroupsDataSet.GetGroupUsers("Automation").Count() == 2, "Expected 2 users for Automation group"); Assert.True(testGroupsDataSet.GetGroupUsers("Automation").Contains("*****@*****.**", StringComparer.OrdinalIgnoreCase), "Expected [email protected] to be in Automation"); Assert.True(testGroupsDataSet.GetGroupUsers("Automation").Contains("*****@*****.**", StringComparer.OrdinalIgnoreCase), "Expected [email protected] to be in Automation"); Assert.True(testGroupsDataSet.GetGroupUsers("all").Count() == 6, "Expected 6 users for 'all' group"); Assert.True(testGroupsDataSet.GetGroupUsers("all").Contains("*****@*****.**", StringComparer.OrdinalIgnoreCase), "Expected [email protected] to be in 'all'"); Assert.True(testGroupsDataSet.GetGroupUsers("all").Contains("*****@*****.**", StringComparer.OrdinalIgnoreCase), "Expected [email protected] to be in 'all'"); Assert.True(testGroupsDataSet.GetGroupUsers("all").Contains("*****@*****.**", StringComparer.OrdinalIgnoreCase), "Expected [email protected] to be in 'all'"); }