Пример #1
0
        public void ValidateProteinAlphabetGetConsensusSymbol()
        {
            ISequence       seq = new Sequence(Alphabets.Protein, "AGCTA");
            ProteinAlphabet alp = ProteinAlphabet.Instance;

            HashSet <ISequenceItem> hashSet = new HashSet <ISequenceItem>();

            foreach (ISequenceItem item in seq)
            {
                hashSet.Add(item);
            }

            Assert.IsNotNull(alp.GetConsensusSymbol(hashSet));

            seq     = new Sequence(Alphabets.Protein, "AGCTX");
            hashSet = new HashSet <ISequenceItem>();

            foreach (ISequenceItem item in seq)
            {
                hashSet.Add(item);
            }

            Assert.IsNotNull(alp.GetConsensusSymbol(hashSet));

            seq     = new Sequence(Alphabets.Protein, "-");
            hashSet = new HashSet <ISequenceItem>();

            foreach (ISequenceItem item in seq)
            {
                hashSet.Add(item);
            }

            Assert.IsNotNull(alp.GetConsensusSymbol(hashSet));

            // Logs to the NUnit GUI window
            ApplicationLog.WriteLine(
                "Alphabets BVT: Validation of GetBasicSymbols() method completed successfully.");
            Console.WriteLine(
                "Alphabets BVT: Validation of GetBasicSymbols() method completed successfully.");
        }
Пример #2
0
        public void InValidateProteinAlphabetGetConsensusSymbol()
        {
            ProteinAlphabet alp = ProteinAlphabet.Instance;

            try
            {
                HashSet <ISequenceItem> hashSet = new HashSet <ISequenceItem>();
                hashSet.Add(null);
                alp.GetConsensusSymbol(hashSet);
                Assert.Fail();
            }
            catch (ArgumentException)
            {
                // Logs to the NUnit GUI window
                ApplicationLog.WriteLine(
                    "Alphabets P2: Validation of GetConsensusSymbol() method completed successfully.");
                Console.WriteLine(
                    "Alphabets P2: Validation of GetConsensusSymbol() method completed successfully.");
            }
        }