예제 #1
0
        public void EcgStringTest()
        {
            var annotationCode = AnnotationCode.Pace;

            // Setup
            var oldString = annotationCode.String;

            // generic string
            var testString = "Test String";

            // get set test
            annotationCode.EcgString = testString;                 // set
            Assert.AreEqual(annotationCode.EcgString, testString); // get

            // Parse test
            var parseResult1 = AnnotationCode.ParseEcgString(testString);

            Assert.AreEqual(parseResult1, annotationCode);

            // null string
            testString = null;
            // get set test
            annotationCode.EcgString = testString;                   // set
            Assert.AreEqual(annotationCode.EcgString, string.Empty); //get

            // ROLLBACK
            annotationCode.EcgString = oldString;
            parseResult1             = AnnotationCode.ParseEcgString(testString);
            var parseResult2 = AnnotationCode.ParseEcgString(oldString);

            Assert.AreNotEqual(parseResult1, annotationCode);
            Assert.AreEqual(parseResult2, annotationCode);
        }
예제 #2
0
 public void AhaToMitMapTest()
 {
     for (char i = 'E'; i < ']'; i++)
     {
         var result = AnnotationCode.MapAhaToMit(i);
         Assert.AreEqual(result, ExpectedAhaToMitMapResult[i - 'E']);
     }
 }
예제 #3
0
        public void ParseEcgString()
        {
            var expectedAnnotationCode = AnnotationCode.PWave;
            var result = AnnotationCode.ParseEcgString(expectedAnnotationCode.EcgString);

            Assert.AreEqual(result, expectedAnnotationCode);

            // INVALID INPUT STRING
            expectedAnnotationCode = AnnotationCode.NotQrs;
            Assert.AreEqual(AnnotationCode.ParseEcgString("Some invalid string"), expectedAnnotationCode);
            Assert.AreEqual(AnnotationCode.ParseEcgString(null), expectedAnnotationCode);
        }
예제 #4
0
        public void ParseTest()
        {
            // Basic test
            var expectedAnnotationCode = AnnotationCode.Pace;
            var parseResult            = AnnotationCode.Parse(expectedAnnotationCode.String);

            Assert.AreEqual(parseResult, expectedAnnotationCode);

            // INVALID INPUT STRING
            expectedAnnotationCode = AnnotationCode.NotQrs;
            Assert.AreEqual(AnnotationCode.Parse("Some invalid string"), expectedAnnotationCode);
            Assert.AreEqual(AnnotationCode.Parse(null), expectedAnnotationCode);
        }