Exemplo n.º 1
0
        void TryGetComplementSymbol(AlphabetsTypes option)
        {
            IAlphabet alphabetInstance = null;
            byte      inputByte = 0, complementByte = 0, outputByte = 0;

            switch (option)
            {
            case AlphabetsTypes.Protein:
                alphabetInstance = ProteinAlphabet.Instance;
                inputByte        = (byte)'F';
                complementByte   = (byte)'U';
                break;

            case AlphabetsTypes.Rna:
                alphabetInstance = RnaAlphabet.Instance;
                inputByte        = (byte)'A';
                complementByte   = (byte)'U';
                break;

            case AlphabetsTypes.Dna:
                alphabetInstance = DnaAlphabet.Instance;
                inputByte        = (byte)'A';
                complementByte   = (byte)'T';
                break;
            }

            if (!option.Equals(AlphabetsTypes.Protein))
            {
                Assert.AreEqual(true, alphabetInstance.TryGetComplementSymbol(inputByte, out outputByte));
                Assert.AreEqual(complementByte, outputByte);
            }
            else
            {
                Assert.AreEqual(false, alphabetInstance.TryGetComplementSymbol(inputByte, out outputByte));
            }

            ApplicationLog.WriteLine(string.Concat("Alphabets BVT: Validation of Get Complement operation for",
                                                   option, " completed successfully."));
        }