public static IPatientMonitor GetPatientMonitor() { if (patientMonitor == null) { List <IVitalSignGenerator> lstVitalSignGenerator = new List <IVitalSignGenerator>() { spo2Generator, pulserateGenerator, temperatureGenerator }; patientMonitor = new PatientMonitor(lstVitalSignGenerator); } return(patientMonitor); }
//It checks if there is any null in generated json public void Given_Patient_Id_When_GenerateVitalSignAsJson_Invoke_Then_Valid_Result_Asserted() { IPatientMonitor m_patientMonitor = Factory.GetPatientMonitor(); string m_actualValue = m_patientMonitor.GenerateVitalSignAsJson("PatientId_23"); string[] m_values = m_actualValue.Split(','); //It checks there should be 8 entity in the json string Assert.AreEqual(4, m_values.Length); foreach (string value in m_values) { string[] args = value.Split(':'); if (args.Length != 2) { Assert.Fail("Failed"); } } }
public Controller() { m_patientMonitor = Factory.GetPatientMonitor(); m_vitalSignEnabler = Factory.GetVitalSignEnabler(); m_vitalSignWriter = Factory.GetVitalSignWriter(); }