public void WindowsGroupPermissionComparer_Compare_XorYNull_Returns1() { //------------Setup for test------------------------- var comparer = new WindowsGroupPermissionComparer(ListSortDirection.Ascending, "WindowsGroup"); //------------Execute Test--------------------------- //------------Assert Results------------------------- var result = comparer.Compare(null, null); Assert.AreEqual(1, result); result = comparer.Compare(new WindowsGroupPermission(), null); Assert.AreEqual(1, result); }
public void WindowsGroupPermissionComparer_Compare_YIsNew_ReturnsMinValue() { //------------Setup for test------------------------- var comparer = new WindowsGroupPermissionComparer(ListSortDirection.Ascending, "WindowsGroup"); //------------Execute Test--------------------------- var result = comparer.Compare(new WindowsGroupPermission(), new WindowsGroupPermission { IsNew = true }); //------------Assert Results------------------------- Assert.AreEqual(int.MinValue, result); }
public void WindowsGroupPermissionComparer_Compare_XIsBuiltInAdministrators_ReturnsMinValue() { //------------Setup for test------------------------- var comparer = new WindowsGroupPermissionComparer(ListSortDirection.Ascending, "WindowsGroup"); //------------Execute Test--------------------------- var result = comparer.Compare(new WindowsGroupPermission { IsServer = true, WindowsGroup = WindowsGroupPermission.BuiltInAdministratorsText }, new WindowsGroupPermission()); //------------Assert Results------------------------- Assert.AreEqual(int.MinValue, result); }
void Verify_Compare(int expected, ListSortDirection direction, string sortMemberPath, WindowsGroupPermission px, WindowsGroupPermission py) { //------------Setup for test------------------------- var comparer = new WindowsGroupPermissionComparer(direction, sortMemberPath); //------------Execute Test--------------------------- var result = comparer.Compare(px, py); //------------Assert Results------------------------- Assert.AreEqual(expected, result); }
[TestCategory("WindowsGroupPermissionComparer_Compare")]//This is to ensure that Public comes after administrators public void WindowsGroupPermissionComparer_Compare_YIsBuiltInGuest_ReturnsMaxValueLessOne() { //------------Setup for test------------------------- var comparer = new WindowsGroupPermissionComparer(ListSortDirection.Ascending, "WindowsGroup"); //------------Execute Test--------------------------- var result = comparer.Compare(new WindowsGroupPermission(), new WindowsGroupPermission { IsServer = true, WindowsGroup = WindowsGroupPermission.BuiltInGuestsText }); //------------Assert Results------------------------- Assert.AreEqual(int.MaxValue - 1, result); }