コード例 #1
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);
            }
        }
コード例 #2
0
        public void OpenAll0Test()
        {
            var annotators = new Annotator[0];

            Annotator.OpenAll(annotators, "data/100s");
            Annotator.CloseAll();
        }
コード例 #3
0
        public void OpenAllNWithInvalidAnnotatorTest()
        {
            var annotators = new Annotator[2];

            annotators[0] = new Annotator {
                Name = "atr", Stat = Stat.Read
            };
            // annotators[1] has not been set
            Annotator.OpenAll(annotators, "data/100s");
        }
コード例 #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);
        }