コード例 #1
0
		/** Tests the creation of a sorting index for the rows of a PWM */
		public void TestSortingIndex () {
			PWM pwm = new PWM( "test", alpha, 0.0 );
			pwm.Add( 'a', "1 3 2" );
			pwm.Add( 'g', "2 2 1" );
			pwm.Add( 'c', "3 1 3" );
			Symbol[] index = pwm.SortingIndex( 0 );
			Assert.AreEqual( 'a', index[0].Letter );
			Assert.AreEqual( 'g', index[1].Letter );
			Assert.AreEqual( 'c', index[2].Letter );
			index = pwm.SortingIndex( 1 );
			Assert.AreEqual( 'c', index[0].Letter );
			Assert.AreEqual( 'g', index[1].Letter );
			Assert.AreEqual( 'a', index[2].Letter );
			index = pwm.SortingIndex( 2 );
			Assert.AreEqual( 'g', index[0].Letter );
			Assert.AreEqual( 'a', index[1].Letter );
			Assert.AreEqual( 'c', index[2].Letter );
		}