public void TestAlarmSet()
        {
            Mock<IPatientAlarmer> testPatientAlarm = new Mock<IPatientAlarmer>();

            PatientDataWriter testDataWriter = new PatientDataWriter {AlarmToBeStored = testPatientAlarm.Object};
            Assert.AreEqual(testPatientAlarm.Object, testDataWriter.AlarmToBeStored);
        }
Пример #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);
        }
Пример #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 TestWriteData()
 {
     Mock<IPatientAlarmer> testAlarmer = new Mock<IPatientAlarmer>();
     testAlarmer.Setup(a => a.AlarmTesters).Returns(new List<IAlarmTester>());
     PatientDataWriter testDataWriter = new PatientDataWriter();
     testDataWriter.WriteData(testAlarmer.Object);
     Assert.Fail();
 }
 public void TestWriterConstructor()
 {
     PatientDataWriter testDataWriter = new PatientDataWriter();
     Assert.IsNotNull(testDataWriter);
 }
 public void TestBedSet()
 {
     int testBedNumber = 1;
     PatientDataWriter testDataWriter = new PatientDataWriter {BedNumber = testBedNumber};
     Assert.AreEqual(testBedNumber, testDataWriter.BedNumber);
 }