public void RenameInvalidEntryNameTest() { string name = "Test Entry"; string newEntryName = ".\\Test*!"; RasPhoneBook pbk = new RasPhoneBook(); RasEntry target = new RasEntry(name); target.Owner = pbk; Mock<IRasHelper> mock = new Mock<IRasHelper>(); RasHelper.Instance = mock.Object; mock.Setup(o => o.IsValidEntryName(pbk, newEntryName)).Returns(false); target.Rename(newEntryName); }
public void RenameEmptyEntryNameExceptionTest() { string name = "Test Entry"; string newEntryName = string.Empty; RasEntry target = new RasEntry(name); target.Rename(newEntryName); }
public void RenameEntryNotInPhoneBookTest() { string name = "Test Entry"; string newEntryName = "New Entry"; bool expected = true; RasEntry target = new RasEntry(name); bool actual = target.Rename(newEntryName); Assert.AreEqual(expected, actual); Assert.AreEqual(newEntryName, target.Name); }
public void RenameNullEntryNameExceptionTest() { string name = "Test Entry"; string newEntryName = null; RasEntry target = new RasEntry(name); target.Rename(newEntryName); }