Esempio n. 1
0
        public void ValidateSparseSequenceGetEnumerator()
        {
            byte[] byteArrayObj = Encoding.ASCII.GetBytes("ACGT");

            IEnumerable <byte> seqItems =
                new List <Byte> {
                byteArrayObj[0], byteArrayObj[1], byteArrayObj[2], byteArrayObj[3]
            };

            var sparseSeqObj          = new SparseSequence(Alphabets.DNA, 0, seqItems);
            IEnumerator <byte> seqObj = sparseSeqObj.GetEnumerator();
            int i = 0;

            while (seqObj.MoveNext())
            {
                Assert.AreEqual(byteArrayObj[i], seqObj.Current);
                i++;
            }
            i = 0;
            foreach (byte alp in sparseSeqObj)
            {
                Assert.AreEqual(byteArrayObj[i], alp);
                i++;
            }

            ApplicationLog.WriteLine("SparseSequenceBVT: Validation of GetEnumerator() method successfully completed");
        }
Esempio n. 2
0
        public void ValidateSparseSequenceGetEnumerator()
        {
            SparseSequence sparseSeqObj            = CreateSparseSequence(Alphabets.DNA, 0);
            IEnumerator <ISequenceItem> enumResult = sparseSeqObj.GetEnumerator();

            // Validate if there are no exceptions from the public method and enum is not null.
            Assert.IsNotNull(enumResult);
            Console.WriteLine(
                "SparseSequenceBVT: Validation of GetEnumerator() is completed");
            ApplicationLog.WriteLine(
                "SparseSequenceBVT:  Validation of GetEnumerator() is completed");
        }
Esempio n. 3
0
        /// <summary>
        /// Creates a sparse sequence and store sequence items of alphabet.
        /// Gets sequence items list using GetEnumerator() method and validates
        /// sequence item list
        /// </summary>
        /// <param name="alphabet">alphabet instance.</param>
        private void ValidateSparseSequenceGetEnumerator(IAlphabet alphabet)
        {
            SparseSequence sparseSequence    = CreateSparseSequence(alphabet, 0);
            IEnumerator <ISequenceItem> list = sparseSequence.GetEnumerator();

            foreach (ISequenceItem item in alphabet)
            {
                list.MoveNext();
                Assert.AreEqual(list.Current, item);
            }

            Console.WriteLine("SparseSequenceP1: Validation of GetEnumerator() method is completed");
            ApplicationLog.WriteLine("SparseSequenceP1: Validation of GetEnumerator() method is completed");
        }
        public void ValidateSparseSequenceGetEnumerator()
        {
            byte[] byteArrayObj = Encoding.ASCII.GetBytes("ACGT");

            IEnumerable<byte> seqItems =
                new List<Byte> {byteArrayObj[0], byteArrayObj[1], byteArrayObj[2], byteArrayObj[3]};

            var sparseSeqObj = new SparseSequence(Alphabets.DNA, 0, seqItems);
            IEnumerator<byte> seqObj = sparseSeqObj.GetEnumerator();
            int i = 0;
            while (seqObj.MoveNext())
            {
                Assert.AreEqual(byteArrayObj[i], seqObj.Current);
                i++;
            }
            i = 0;
            foreach (byte alp in sparseSeqObj)
            {
                Assert.AreEqual(byteArrayObj[i], alp);
                i++;
            }

            ApplicationLog.WriteLine("SparseSequenceBVT: Validation of GetEnumerator() method successfully completed");
        }