public void Setup() { var tempMediaPath = MediaFileInfoTests.GetLongerTestAudioFile(); _tempFolder = new TemporaryFolder("TierCollectionTests"); var mediaFile = Path.Combine(_tempFolder.Path, "mediaFile.wav"); File.Move(tempMediaPath, mediaFile); _collection = new TierCollection(mediaFile); _collection.Clear(); var timeTier = new TimeTier("timeTier", mediaFile); _collection.Add(timeTier); var transcriptionTier = new TextTier(TextTier.ElanTranscriptionTierId); _collection.Add(transcriptionTier); var translationTier = new TextTier(TextTier.ElanTranslationTierId); _collection.Add(translationTier); var otherTextTier = new TextTier("otherTextTier"); _collection.Add(otherTextTier); timeTier.AddSegment(10f, 20f); timeTier.AddSegment(20f, 30f); timeTier.AddSegment(30f, 40f); transcriptionTier.AddSegment("trans1"); transcriptionTier.AddSegment("trans2"); transcriptionTier.AddSegment("trans3"); translationTier.AddSegment("free1"); translationTier.AddSegment("free2"); translationTier.AddSegment(null); otherTextTier.AddSegment("other1"); otherTextTier.AddSegment(null); otherTextTier.AddSegment(null); Assert.AreEqual(mediaFile, _collection.AnnotatedMediaFile); Assert.AreEqual(4, _collection.Count); }
public void RemoveTierSegments_IndexOutOfRangeLow_ReturnFalse() { Assert.IsFalse(_collection.RemoveTierSegments(-1)); _collection.Clear(); Assert.IsFalse(_collection.RemoveTierSegments(0)); }