public void GoodUnconnectedCreation()
 {
     var dataReader = new PatientDataReader();
     dataReader.Connect(@"..\..\..\DataTest.csv");
     Assert.AreEqual(firstLine, dataReader.getData());
     Assert.AreEqual(secondLine, dataReader.getData());
 }
Exemplo n.º 2
0
        public object CreateAndReturnObj(PatientClassesEnumeration objectToGet)
        {
            object createdObject = null;

            switch (objectToGet)
            {
            case PatientClassesEnumeration.PatientAlarmer:
                PatientAlarmer alarmer = new PatientAlarmer();
                createdObject = alarmer;
                break;

            case PatientClassesEnumeration.PatientDataReader:
                PatientDataReader dataReader = new PatientDataReader();
                createdObject = dataReader;
                break;

            case PatientClassesEnumeration.PatientData:
                PatientData patientData = new PatientData();
                createdObject = patientData;
                break;

            case PatientClassesEnumeration.PatientDataWriter:
                PatientDataWriter dataWriter = new PatientDataWriter();
                createdObject = dataWriter;
                break;

            default:
                throw new ArgumentException("Invalid parameter passed");
            }
            return(createdObject);
        }
Exemplo n.º 3
0
        public object CreateAndReturnObj(PatientClassesEnumeration objectToGet)
        {
            object createdObject = null;

            switch (objectToGet)
            {
                case PatientClassesEnumeration.PatientAlarmer:
                    PatientAlarmer alarmer = new PatientAlarmer();
                    createdObject = alarmer;
                    break;
                case PatientClassesEnumeration.PatientDataReader:
                    PatientDataReader dataReader = new PatientDataReader();
                    createdObject = dataReader;
                    break;
                case PatientClassesEnumeration.PatientData:
                    PatientData patientData = new PatientData();
                    createdObject = patientData;
                    break;
                case PatientClassesEnumeration.PatientDataWriter:
                    PatientDataWriter dataWriter = new PatientDataWriter();
                    createdObject = dataWriter;
                    break;
                default:
                    throw new ArgumentException("Invalid parameter passed");
            }
            return createdObject;
        }
 public void GoodUnconnectedCreation()
 {
     // Checks to see whether the file called DataTest.csv contains the values setup above.
     // If the values in the DataTest.csv are equal to the the values setup. The test will pass. (NW)
     var dataReader = new PatientDataReader();
     dataReader.Connect(@"..\..\..\DataTest.csv");
     Assert.AreEqual(FirstLine, dataReader.GetData());
     Assert.AreEqual(SecondLine, dataReader.GetData());
 }
Exemplo n.º 5
0
        // Sets up the model of the program
        private void SetupComponents()
        {
            _patientData = (PatientData)_patientFactory.CreateAndReturnObj(PatientClassesEnumeration.PatientData);
            _dataReader  =
                (PatientDataReader)_patientFactory.CreateAndReturnObj(PatientClassesEnumeration.PatientDataReader);
            _alarmer = (PatientAlarmer)_patientFactory.CreateAndReturnObj(PatientClassesEnumeration.PatientAlarmer);

            _alarmer.ModuleAlarm += SoundMutableAlarm;

            _tickTimer.Stop();
            _tickTimer.Interval = TimeSpan.FromMilliseconds(1000);
            _tickTimer.Tick    += UpdateReadings;
        }
        // Sets up the model of the program
        private void SetupComponents()
        {
            _patientData = (PatientData) _patientFactory.CreateAndReturnObj(PatientClassesEnumeration.PatientData);
            _dataReader =
                (PatientDataReader) _patientFactory.CreateAndReturnObj(PatientClassesEnumeration.PatientDataReader);
            _alarmer = (PatientAlarmer) _patientFactory.CreateAndReturnObj(PatientClassesEnumeration.PatientAlarmer);

            _alarmer.ModuleAlarm += SoundMutableAlarm;

            _tickTimer.Stop();
            _tickTimer.Interval = TimeSpan.FromMilliseconds(1000);
            _tickTimer.Tick += UpdateReadings;
        }
 public void HasGoodCreation()
 {
     // Checks to see whether there is a file named DataTest within the same directory as NewPatientMonitor. (NW)
     var dataReader = new PatientDataReader(@"..\..\..\DataTest.csv");
 }
 public void GoodCreation()
 {
     // Checks
     var dataReader = new PatientDataReader(@"..\..\..\DataTest.csv");
 }