コード例 #1
0
        public void TestInsertDeviceUnsuccessful()
        {
            var           controller = new MedicalDeviceController(_deviceRepo, _patientRepo);
            MedicalDevice device     = new MedicalDevice {
                DeviceName = "Oxymeter", MaxValue = 100, MinValue = 50
            };
            var actualResponse       = controller.InsertDevice(device);
            var actualResponseObject = actualResponse as ObjectResult;

            Assert.NotNull(actualResponseObject);
            Assert.Equal(500, actualResponseObject.StatusCode);
        }
コード例 #2
0
        public void TestInsertDeviceValidationFailure()
        {
            var           controller = new MedicalDeviceController(_deviceRepo, _patientRepo);
            MedicalDevice device     = new MedicalDevice {
                DeviceName = "device", MaxValue = 20, MinValue = 50
            };
            var actualResponse       = controller.InsertDevice(device);
            var actualResponseObject = actualResponse as BadRequestObjectResult;

            Assert.NotNull(actualResponseObject);
            Assert.Equal(400, actualResponseObject.StatusCode);
        }