コード例 #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);
        }
コード例 #5
0
        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);
        }