示例#1
0
        public void GivenValidDnaChainWhenNotFoundFourEqualProteinsDiagonallyThenReturnZero()
        {
            //Given
            string[,] dnaChain =
            {
                { "C", "T", "G", "T", "G", "A" },
                { "C", "T", "A", "C", "C", "G" },
                { "T", "A", "T", "T", "G", "T" },
                { "A", "G", "A", "T", "G", "G" },
                { "C", "C", "T", "C", "A", "A" },
                { "T", "C", "A", "C", "T", "G" }
            };
            //When
            int totalOfChainsFound = DnaAnalizer.AnalizeDiagonally(dnaChain);

            //Then
            Assert.Equal(0, totalOfChainsFound);
        }
        public static bool isSimian(string[,] dnaChain)
        {
            int total = 0;

            Parallel.Invoke(() =>
            {
                total += DnaAnalizer.AnalizeDiagonally(dnaChain);
            },
                            () =>
            {
                total += DnaAnalizer.AnalizeDiagonallyInverted(dnaChain);
            },
                            () =>
            {
                total += DnaAnalizer.AnalizeHorizontally(dnaChain);
            },
                            () =>
            {
                total += DnaAnalizer.AnalizeVertically(dnaChain);
            }
                            );

            return(total > 1);
        }