Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }