コード例 #1
0
		public void TestConstructor () {
			Definition container = new Definition();
			container.Definitions.Add( new Definition( "Def", new Any( "Any", 1, 3, 1 ) ) );
			Use use = new Use { Name = "Use" };
			use.ReferTo( container, "Def" );
			Assert.AreEqual( "Use", use.Name );
			Assert.AreEqual( "Def", use.ReferencedDefinition.Name );
		}
コード例 #2
0
		public void TestMatch ()
        {
			Definition def = new Definition();
			def.Definitions.Add( new Definition("Def", new Motif("Motif", AlphabetType.DNA, "atg", 0.0)) );
            Sequence seq = new Sequence(AlphabetType.DNA, "atgc");
            Use use = new Use{ Name = "Use" };
			use.ReferTo( def, "Def" );
            Match match = use.Match(seq, 1);
            Assert.AreEqual(use, match.MatchPattern);
            Assert.AreEqual(1, match.Start);
            Assert.AreEqual(3, match.Length);
            Assert.AreEqual(1, match.Strand);
            Assert.AreEqual(1.0, match.Similarity, 1e-2);
        }