public void JsonAddBookingJsonToObjectTest() { TemplateJson tl = new JsonAddBooking(); var o = tl.GetObject(correctJson) as Booking; Assert.AreEqual(sesseionID, o.GetSessionID()); Assert.AreEqual(apt, o.GetAppointmentType()); Assert.AreEqual(den, o.GetDentist()); Assert.AreEqual(day, o.GetDay()); Assert.AreEqual(time, o.GetTime()); }
public void JsonAddBookingJsonToObjectInvalidTest() { bool exception = false; var incorrect = "{\"emails\":\"[email protected]\",\"password\":\"Password\"}"; TemplateJson tl = new JsonAddBooking(); try { var o = tl.GetObject(incorrect) as Booking; } catch (Exception) { exception = true; } Assert.IsTrue(exception); }