Example #1
0
        public void GetDevice_IncorrectIndex()
        {
            // Arrange
            int id = -1;
            DeviceInfoController controller = new DeviceInfoController();

            // Act
            NotFoundResult result = controller.GetDevice(id) as NotFoundResult;

            // Assert
            Assert.NotNull(result);
        }
Example #2
0
        public void GetDevice_CorrectIndex()
        {
            // Arrange
            int id = 1;
            DeviceInfoController controller = new DeviceInfoController();

            // Act
            OkNegotiatedContentResult <DeviceViewModel> result = controller.GetDevice(id) as OkNegotiatedContentResult <DeviceViewModel>;

            // Assert
            Assert.NotNull(result);
            Assert.That(result.Content.Id == id);
        }