Esempio n. 1
0
        public void GetListId_NoError()
        {
            int testId = GroceryListAccessor.GetListId(1, "title1");

            if (testId != 1)
            {
                Assert.Fail("Not the right ID." + testId);
            }
        }
Esempio n. 2
0
 public void UpdateList_NoError()
 {
     try
     {
         GroceryListAccessor.UpdateList(2, 2, "title2", "title2Updated", "site2");
     }
     catch (InvalidOperationException e)
     {
         StringAssert.Contains(e.Message, "");
     }
     return;
 }
Esempio n. 3
0
 public void AddList_NoError()
 {
     try
     {
         GroceryListAccessor.AddList("title7", "target", DateTime.Now, 1);
     }
     catch (InvalidOperationException e)
     {
         StringAssert.Contains(e.Message, "");
     }
     return;
 }
Esempio n. 4
0
 //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.");
 }
Esempio n. 5
0
 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.");
 }
Esempio n. 6
0
        public void GetTest()
        {
            string jaggedArray = GroceryListAccessor.GetAllLists("*****@*****.**");

            //Assert.AreEqual(testName, "title1");
        }
Esempio n. 7
0
        public void GetListName_NoError()
        {
            string testName = GroceryListAccessor.GetListTitle(1, 1);

            Assert.AreEqual(testName, "title1");
        }