Пример #1
0
        public void NumberTest()
        {
            var annotator1 = new Annotator {
                Name = "atr", Stat = Stat.Read
            };

            annotator1.Open("data/100s");
            Assert.AreEqual(0, annotator1.Number);

            var annotator2 = new Annotator {
                Name = "hrv", Stat = Stat.Read
            };

            annotator2.Open("data/100s");
            Assert.AreEqual(0, annotator1.Number);
            Assert.AreEqual(1, annotator2.Number);

            annotator1.Close();
            Assert.AreEqual(-1, annotator1.Number);
            Assert.AreEqual(0, annotator2.Number);

            annotator1.Open("data/100s");
            Assert.AreEqual(0, annotator2.Number);
            Assert.AreEqual(1, annotator1.Number);
            Annotator.CloseAll();

            Assert.AreEqual(-1, annotator1.Number);
            Assert.AreEqual(-1, annotator2.Number);
        }
Пример #2
0
        public void OpenAllNTest()
        {
            var annotators = new Annotator[2];

            annotators[0] = new Annotator {
                Name = "atr", Stat = Stat.Read
            };
            annotators[1] = new Annotator {
                Name = "hrv", Stat = Stat.Read
            };
            Annotator.OpenAll(annotators, "data/100s");

            int counter = 0;

            foreach (var annotator in annotators)
            {
                Assert.IsTrue(annotator.IsOpen);
                Assert.AreEqual(counter, annotator.Number);
                counter++;
            }

            Annotator.CloseAll();
            foreach (var annotator in annotators)
            {
                Assert.IsFalse(annotator.IsOpen);
            }
        }
Пример #3
0
        public void OpenAll0Test()
        {
            var annotators = new Annotator[0];

            Annotator.OpenAll(annotators, "data/100s");
            Annotator.CloseAll();
        }
Пример #4
0
        public void OpenAll1Test()
        {
            var annotators = new Annotator[1];

            annotators[0] = new Annotator {
                Name = "atr", Stat = Stat.Read
            };
            Annotator.OpenAll(annotators, "data/100s");

            Assert.IsTrue(annotators[0].IsOpen);

            Annotator.CloseAll();
            Assert.IsFalse(annotators[0].IsOpen);
        }
Пример #5
0
 public void FreeResources()
 {
     // Closing any open annotators
     Annotator.CloseAll();
 }