public void Given_ValidSpo2_Parameter_When_ValidateParameter_Invoked_Then_Expected_True()
        {
            PatientSpo2Validator obj = new PatientSpo2Validator();
            bool expectedValue       = true;
            bool actualValue         = obj.ValidateParameter <double>(98);

            Assert.AreEqual(expectedValue, actualValue);
        }
        public void Given_InValidSpo2_Parameter_When_ValidateParameter_Invoked_Then_Expected_False()
        {
            PatientSpo2Validator ValidatorObj = new PatientSpo2Validator();
            bool expectedValue = false;
            bool actualValue   = ValidatorObj.ValidateParameter <double>(498);

            Assert.AreEqual(expectedValue, actualValue);
        }
Exemple #3
0
        public List <AlertFinalListStructure> GenerateAndValidate(List <PatientInfo> listOfPatient)
        {
            List <AlertFinalListStructure> FinalResult = new List <AlertFinalListStructure>();

            foreach (PatientInfo patient in listOfPatient)
            {
                bool[] parameterArray = new bool[3] {
                    true, true, true
                };
                AlertFinalListStructure alertFinalResultObj = new AlertFinalListStructure();

                IPatientRandomVitalsGenerator spo2GenerateObj = new PatientSpo2RandomGenerator();
                decimal patientSpo2Result = spo2GenerateObj.GenerateParameter <decimal>(patient.PatientID, listOfPatient);
                IPatientParameterValidator spo2ValidatorObj = new PatientSpo2Validator();
                bool validSpo2 = spo2ValidatorObj.ValidateParameter(patientSpo2Result);
                parameterArray[0] = validSpo2;

                IPatientRandomVitalsGenerator pulseRateGenerateObj = new PatientPulseRateRandomGenerator();
                decimal patientPulseRateResult = pulseRateGenerateObj.GenerateParameter <decimal>(patient.PatientID, listOfPatient);
                IPatientParameterValidator PulseRateValidatorObj = new PatientSpo2Validator();
                bool validPulseRate = PulseRateValidatorObj.ValidateParameter(patientPulseRateResult);
                parameterArray[1] = validPulseRate;

                IPatientRandomVitalsGenerator tempratureGenerateObj = new PatientTempratureRandomGenerator();
                double patientTempratureResult = tempratureGenerateObj.GenerateParameter <double>(patient.PatientID, listOfPatient);
                IPatientParameterValidator tempratureValidatorObj = new PatientTempratureValidator();
                bool validTemprature = tempratureValidatorObj.ValidateParameter(patientTempratureResult);
                parameterArray[2] = validTemprature;

                PatientVitalsNetChecker netCheckerObj = new PatientVitalsNetChecker();
                bool finalResult = netCheckerObj.AnalysisResult(parameterArray);
                alertFinalResultObj.BedID   = patient.BedID;
                alertFinalResultObj.Healthy = finalResult;
                FinalResult.Add(alertFinalResultObj);
            }

            return(FinalResult);
        }