Пример #1
0
        public void FormGetWithId_NotFound()
        {
            // Arramge
            FormulierenController controller = GetController();

            // Act
            HttpResponseMessage actionResult = controller.Get(-2);

            // Assert
            Assert.AreEqual(actionResult.StatusCode, HttpStatusCode.NotFound);
        }
Пример #2
0
        public void FormGetWithId_Ok()
        {
            // Arramge
            FormulierenController controller = GetController();

            // Act
            //How to determine wich id to pass?
            HttpResponseMessage actionResult = controller.Get(this.id);

            // Assert
            Assert.AreEqual(actionResult.StatusCode, HttpStatusCode.OK);
        }
Пример #3
0
        public void FormDeleteWithId_NotFound()
        {
            // Arramge
            FormulierenController controller = GetController();

            // Act
            //How to determine wich id to pass?
            HttpResponseMessage actionResult = controller.Get(-2);

            // Assert
            Assert.AreEqual(actionResult.StatusCode, HttpStatusCode.NotFound);
        }
Пример #4
0
        public void FormGet_Ok()
        {
            // Arramge
            FormulierenController controller = GetController();

            // Act
            HttpResponseMessage actionResult = controller.Get();

            // Assert
            Assert.IsTrue(actionResult.TryGetContentValue(out List <Formulieren> formulier));
            this.id = formulier.FirstOrDefault().Id;
            Assert.AreEqual(actionResult.StatusCode, HttpStatusCode.OK);
        }
        public int GetFormulierenTemplateId()
        {
            FormulierenController formulierencontroller = new FormulierenController
            {
                Request       = new System.Net.Http.HttpRequestMessage(),
                Configuration = new HttpConfiguration()
            };

            // Act
            HttpResponseMessage actionResult = formulierencontroller.Get();

            // Assert
            List <Formulieren> formulier;

            Assert.IsTrue(actionResult.TryGetContentValue <List <Formulieren> >(out formulier));
            return(formulier.FirstOrDefault().Id);
        }