private void ShowCustomerByID() { Console.Clear(); Console.WriteLine("Enter the title of the content you'd like to see."); string id = Console.ReadLine(); C5Emails customer = repo.GetCustomerByID(id); if (customer != null) { ShowCustomer(customer); } else { Console.WriteLine("That title doesn't exist."); } Console.ReadKey(); }
public void GetByTitle_ShouldReturnCorrectContent() { //Arrange C5_Repo repo = new C5_Repo(); C5Emails newContent = new C5Emails("Jim", "Istired", "verytired", CustomerType.Past); repo.AddToList(newContent); string id = "Jim"; //Act C5Emails searchResult = repo.GetCustomerByID(id); //Assert Assert.AreEqual(searchResult.ID, id); }
public void DeleteExistingContent_ShouldReturnTrue() { //Arrange C5_Repo repo = new C5_Repo(); C5Emails content = new C5Emails("Jim", "Istired", "verytired", CustomerType.Past); repo.AddToList(content); //Act C5Emails oldContent = repo.GetCustomerByID("Jim"); bool removeResult = repo.DeleteExisting(oldContent); //Assert Assert.IsTrue(removeResult); }