public void GetListId_NoError() { int testId = GroceryListAccessor.GetListId(1, "title1"); if (testId != 1) { Assert.Fail("Not the right ID." + testId); } }
public void UpdateList_NoError() { try { GroceryListAccessor.UpdateList(2, 2, "title2", "title2Updated", "site2"); } catch (InvalidOperationException e) { StringAssert.Contains(e.Message, ""); } return; }
public void AddList_NoError() { try { GroceryListAccessor.AddList("title7", "target", DateTime.Now, 1); } catch (InvalidOperationException e) { StringAssert.Contains(e.Message, ""); } return; }
//Example 3 //This test is to make sure the function catches if the new tilte is not already taken. public void UpdateList_Takentitle() { try { GroceryListAccessor.UpdateList(4, 4, "title4", "title3", "site4"); } catch (InvalidOperationException e) { StringAssert.Contains(e.Message, ""); return; } Assert.Fail("The expected exception was not thrown."); }
public void AddList_TakenTitle() { try { GroceryListAccessor.AddList("title1", "target", DateTime.Now, 1); } catch (InvalidOperationException e) { StringAssert.Contains(e.Message, ""); return; } Assert.Fail("The expected exception was not thrown."); }
public void GetTest() { string jaggedArray = GroceryListAccessor.GetAllLists("*****@*****.**"); //Assert.AreEqual(testName, "title1"); }
public void GetListName_NoError() { string testName = GroceryListAccessor.GetListTitle(1, 1); Assert.AreEqual(testName, "title1"); }