public void FormPost_Ok() { // Arramge FormulierenController controller = GetController(); FormulierenBindingModel formulierenBindingModel = new FormulierenBindingModel(); formulierenBindingModel.Name = "Testformulier9999"; formulierenBindingModel.Region = "Zuid-Holland"; formulierenBindingModel.FormTemplate = "[{'Naam':'string'},{'Leeftijd':'string'},{'Afwijking':'string'}]"; // Act HttpResponseMessage actionResult = controller.Post(formulierenBindingModel); // Assert Assert.AreEqual(actionResult.StatusCode, HttpStatusCode.OK); }
public void FormPost_BadRequest() { // Arramge // Arramge FormulierenController controller = GetController(); FormulierenBindingModel formulierenBindingModel = new FormulierenBindingModel(); formulierenBindingModel.Name = "Testformulier9999"; formulierenBindingModel.Region = "Zuid-Holland"; formulierenBindingModel.FormTemplate = "{iets:data"; // Act HttpResponseMessage actionResult = controller.Post(formulierenBindingModel); // Assert Assert.AreEqual(actionResult.StatusCode, HttpStatusCode.BadRequest); }