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); }
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); } }
public void OpenAll0Test() { var annotators = new Annotator[0]; Annotator.OpenAll(annotators, "data/100s"); Annotator.CloseAll(); }
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); }
public void FreeResources() { // Closing any open annotators Annotator.CloseAll(); }