public void JsonAppointmentJsonToObjectTest() { TemplateJson tl = new JsonAppointmentType(); var o = tl.GetObject(correctJson) as AppointmentType; Assert.AreEqual(id, o.GetID()); Assert.AreEqual(desc, o.GetDescription()); Assert.AreEqual(cost, o.GetCost()); }
public void JsonAppointmentJsonToObjectInvalidTest() { bool exception = false; var incorrect = "{\"emails\":\"[email protected]\",\"password\":\"Password\"}"; TemplateJson tl = new JsonAppointmentType(); try { var o = tl.GetObject(incorrect) as AppointmentType; } catch (InvalidLoginJsonException) { exception = true; } Assert.IsTrue(exception); }