public void GetEmailAddress_ShouldThrowExceptionOnNullAccountName() { IMyPrincipalSearcher searcher = new FakePrincipalSearcher(); ActiveDirectoryHelper target = new ActiveDirectoryHelper(searcher); ADUser actual = target.GetEmailAddress(""); }
public void GetEmailAddress_ShouldReturnADUserWithCorrectEmailAddress() { IMyPrincipalSearcher searcher = new FakePrincipalSearcher(); ActiveDirectoryHelper target = new ActiveDirectoryHelper(searcher); ADUser expectedUser = new ADUser() { Email = "*****@*****.**", }; ADUser actual = target.GetEmailAddress("77777777"); Assert.AreEqual(expectedUser.Email, actual.Email); }
public void GetEmailAddress_ShouldThrowExceptionOnNullAccountNameWithCorrectDebugInformation() { IMyPrincipalSearcher searcher = new FakePrincipalSearcher(); ActiveDirectoryHelper target = new ActiveDirectoryHelper(searcher); try { ADUser actual = target.GetEmailAddress(""); } catch (ArgumentNullException ex) { Assert.IsTrue(ex.ParamName == "samAccountName"); return; } Assert.Fail("ArgumentNullException was not thrown."); }