Example #1
0
        public void TestUpdateOneIDOutOfRange()
        {
            //Arrange
            DateTime date = DateTime.Now;
            Test     u    = new Test()
            {
                Temperature         = 37.029838,
                TimeOfDataRecording = date,
                ID            = 50,
                HasFever      = true,
                RaspberryPiID = 1,
            };
            TestsController controller = new TestsController();

            //Act
            StatusCodeResult response = (StatusCodeResult)controller.Put(50, u);

            //Assert
            Assert.AreEqual(response.StatusCode, StatusCodes.Status404NotFound);
        }
Example #2
0
        public void TestUpdateOne()
        {
            //Arrange
            DateTime date = DateTime.Now;
            Test     t    = new Test()
            {
                Temperature         = 37.029838,
                TimeOfDataRecording = date,
                ID            = 3,
                HasFever      = true,
                RaspberryPiID = 1,
            };
            TestsController controller = new TestsController();

            //Act
            StatusCodeResult response = (StatusCodeResult)controller.Put(3, t);

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