/** Tests the construction of a feature list */ public void TestConstructor () { Sequence seq = new Sequence( AlphabetType.DNA, "acgt" ); FeatureList featureList = new FeatureList( "Test" ); seq.AddFeatures( featureList ); Assert.AreEqual( 1, seq.FeatureLists.Count ); Assert.AreEqual( "Test", featureList.Name ); // Assert.AreEqual(seq, featureList.GetSequence()); }
public void TestGetFeatureSequence() { Sequence seq = new Sequence(AlphabetType.DNA, "acgta"); FeatureList featureList = new FeatureList("test"); Feature feature = new Feature("feature1", 2, 4, +1); featureList.Add(feature); seq.AddFeatures(featureList); Assert.AreEqual("cgt", feature.Letters()); }
/** Tests the adding of features */ public void TestAdd () { Sequence seq = new Sequence( AlphabetType.DNA, "acgt" ); FeatureList featureList = new FeatureList( "Test" ); seq.AddFeatures( featureList ); Feature feature1 = new Feature( "Test1", 1, 3, +1 ); Feature feature2 = new Feature( "Test2", 1, 3, +1 ); featureList.Add( feature1, false ); featureList.Add( feature2, true ); Assert.AreEqual( 2, featureList.Count ); Assert.AreEqual( null, feature1.BaseSequence ); Assert.AreEqual( seq, feature2.BaseSequence ); }
public void TestAddGetFeature () { Sequence seq = new Sequence( AlphabetType.DNA, "ACTG" ); FeatureList flist1 = new FeatureList( "test1" ); FeatureList flist2 = new FeatureList( "test2" ); Assert.AreEqual( 0, seq.FeatureLists.Count ); seq.AddFeatures( flist1 ); seq.AddFeatures( flist2 ); Assert.AreEqual( 2, seq.FeatureLists.Count ); Assert.AreEqual( flist1, seq.FeatureLists[ 0 ] ); Assert.AreEqual( flist1, seq.FeatureLists[ "test1" ] ); Assert.AreEqual( flist2, seq.FeatureLists[ 1 ] ); Assert.AreEqual( flist2, seq.FeatureLists[ "test2" ] ); }
public void TestHasFeatures () { Sequence seq = new Sequence( AlphabetType.DNA, "ACTG" ); Assert.AreEqual( false, seq.HasFeatures() ); seq.AddFeatures( new FeatureList( "test1" ) ); Assert.AreEqual( true, seq.HasFeatures() ); }
public void TestAddFeatureLists () { Sequence seq = new Sequence( AlphabetType.DNA, "ACTG" ); FeatureList flist1 = new FeatureList( "test1" ); FeatureList flist2 = new FeatureList( "test2" ); AnnotatedList<FeatureList> flists = new AnnotatedList<FeatureList>(); flists.Add( flist1 ); flists.Add( flist2 ); seq.AddFeatures( flists ); Assert.AreEqual( 2, seq.FeatureLists.Count ); }