Exemple #1
0
        public void TestPostOneRPI_IDOutOfRang()
        {
            //Arrange
            DateTime date = DateTime.Now;
            Test     t    = new Test()
            {
                Temperature         = 35.029838,
                TimeOfDataRecording = date,
                ID            = 1,
                HasFever      = false,
                RaspberryPiID = 118723,
            };
            TestsController controller = new TestsController();

            //Act
            StatusCodeResult response = (StatusCodeResult)controller.Post(t);

            //Assert
            Assert.AreEqual(response.StatusCode, 400);
        }
Exemple #2
0
        public void TestPostOne()
        {
            //Arrange
            DateTime date = DateTime.Now;
            Test     t    = new Test()
            {
                Temperature         = 35.029838,
                TimeOfDataRecording = date,
                ID            = 1,
                HasFever      = false,
                RaspberryPiID = 1,
            };
            TestsController controller = new TestsController();

            //Act
            CreatedAtActionResult response = (CreatedAtActionResult)controller.Post(t);

            //Assert
            Assert.AreEqual(response.StatusCode, 201);
        }