public void PutCoordinatorBuilder_AllFieldsChanged() { Coordinator oldCoordinator = new Coordinator { Name = name, Email = email, Course = course, Password = password, Registration = registration }; Coordinator newCoordinator = new Coordinator { Name = newName, Email = newEmail, Course = newCourse, Password = newPassword, Registration = newRegistration }; JObject obj = CoordinatorParser.PutCoordinatorBuilder(oldCoordinator, newCoordinator); var coordBody = obj["coordinator"]; var coordName = coordBody["name"].ToString(); var coordEmail = coordBody["email"].ToString(); var coordCourse = coordBody["course"].ToString(); var coordPass = coordBody["password"].ToString(); var coordRegist = coordBody["registration"].ToString(); Assert.AreEqual(newName, coordName); Assert.AreEqual(newEmail, coordEmail); Assert.AreEqual(newCourse, coordCourse); Assert.AreEqual(newPassword, coordPass); Assert.AreEqual(newRegistration, coordRegist); }
public void PutCoordinatorBuilder_SomeFieldsChanged() { Coordinator oldCoordinator = new Coordinator { Name = name, Email = email, Course = course, Password = password, Registration = registration }; Coordinator newCoordinator = new Coordinator { Name = newName, Email = newEmail, Course = newCourse }; JObject obj = CoordinatorParser.PutCoordinatorBuilder(oldCoordinator, newCoordinator); var coordBody = obj["coordinator"]; var children = coordBody.Count(); var coordName = coordBody["name"].ToString(); var coordEmail = coordBody["email"].ToString(); var coordCourse = coordBody["course"].ToString(); Assert.AreEqual(newName, coordName); Assert.AreEqual(newEmail, coordEmail); Assert.AreEqual(newCourse, coordCourse); Assert.AreEqual(3, children); }
public void PutCoordinatorBuilder_NoFieldsChanged() { Coordinator oldCoordinator = new Coordinator { Name = name, Email = email, Course = course, Password = password, Registration = registration }; Coordinator newCoordinator = new Coordinator(); JObject obj = CoordinatorParser.PutCoordinatorBuilder(oldCoordinator, newCoordinator); var coordBody = obj["coordinator"]; var children = coordBody.Count(); Assert.AreEqual(0, children); }