Beispiel #1
0
        public void TestAlertDeviceInvalidDevice(string bedId)
        {
            var controller = new MedicalDeviceController(_deviceRepo, _patientRepo);
            var model      = new MedicalStatusDataModel {
                BedId = bedId
            };
            var medicalDevice = new Dictionary <string, int> {
                { "deviceName", 50 }
            };

            model.MedicalDevice = medicalDevice;
            var actualResponse       = controller.IsAlert(model);
            var actualResponseObject = actualResponse.Result as BadRequestObjectResult;

            Assert.NotNull(actualResponseObject);
            Assert.Equal(400, actualResponseObject.StatusCode);
        }
Beispiel #2
0
        public void TestAlertDeviceSuccessfully(string deviceName)
        {
            var controller = new MedicalDeviceController(_deviceRepo, _patientRepo);
            var model      = new MedicalStatusDataModel {
                BedId = "1A1"
            };
            var medicalDevice = new Dictionary <string, int>();

            if (deviceName != "")
            {
                medicalDevice.Add(deviceName, 50);
            }
            model.MedicalDevice = medicalDevice;
            var actualResponse       = controller.IsAlert(model);
            var actualResponseObject = actualResponse.Result as OkObjectResult;

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