public void TestDeleteNotExists () { PoIInfo pInfo = new PoIInfo ("00000000-acd2-4cdf-a65e-cded7bc7833e"); PoIInterface pInterface = new PoIInterface (POI_DP_URL); try { pInterface.Delete (pInfo); } catch (System.Net.WebException ex) { Assert.AreEqual ("The specified UUID was not found from the database!", ex.Message); } }
public void TestAddDelete () { PoIInterface pInterface = new PoIInterface (POI_DP_URL); PoIInfo pInfo = new PoIInfo (); FwCore fwCore = new FwCore (); fwCore.Name = "asd"; fwCore.Category = "restaurant"; fwCore.Location = new Location (0.345, 0.66577); fwCore.Source = new Source ("OpenStreetMap", @"http://www.openstreetmap.org", @"http://www.openstreetmap.org/copyright"); pInfo.FwCore = fwCore; pInfo.FwTime = FwTime.Open; pInfo = pInterface.Add (pInfo); Console.WriteLine (pInfo.Id); Assert.IsNotNullOrEmpty (pInfo.Id); bool retDelete = pInterface.Delete (pInfo); Assert.IsTrue (retDelete); }