示例#1
0
        public void TestImplicitIntConvertion()
        {
            DnaBase dnaBase      = new DnaBase(DnaBase.DnaBaseEnumeration.G);
            int     dnaBaseAsInt = dnaBase;

            Assert.AreEqual(dnaBaseAsInt, (int)DnaBase.DnaBaseEnumeration.G);
        }
示例#2
0
        public void TestImplicitStringConvertion()
        {
            DnaBase dnaBase = new DnaBase(DnaBase.DnaBaseEnumeration.A);
            string  dnaStringRepresentation = dnaBase;

            Assert.AreEqual(dnaStringRepresentation, "A");
        }
示例#3
0
        public void TestConvertionToString()
        {
            DnaBase dnaBase = new DnaBase(DnaBase.DnaBaseEnumeration.A);
            string  dnaStringRepresentation = dnaBase.ToString();

            Assert.AreEqual(dnaStringRepresentation, "A");
        }
示例#4
0
        public void TestElementAt()
        {
            DnaSequence dnaSequence = new DnaSequence("ACGT");
            DnaBase     dnaBase     = dnaSequence.ElementAt(1);

            Assert.AreEqual('C', (char)dnaBase);
        }
示例#5
0
        public void TestImplicitConvertionFromChar()
        {
            DnaBase dnaBase = 'A';

            Assert.AreEqual((int)DnaBase.A, (int)dnaBase);
            dnaBase = 'C';
            Assert.AreEqual((int)DnaBase.C, (int)dnaBase);
            dnaBase = 'G';
            Assert.AreEqual((int)DnaBase.G, (int)dnaBase);
            dnaBase = 'T';
            Assert.AreEqual((int)DnaBase.T, (int)dnaBase);
        }
示例#6
0
        public void TestImplicitConvertionFromString()
        {
            DnaBase dnaBase = "A";

            Assert.AreEqual((int)DnaBase.A, (int)dnaBase);
            dnaBase = "C";
            Assert.AreEqual((int)DnaBase.C, (int)dnaBase);
            dnaBase = "G";
            Assert.AreEqual((int)DnaBase.G, (int)dnaBase);
            dnaBase = "T";
            Assert.AreEqual((int)DnaBase.T, (int)dnaBase);
        }
示例#7
0
        public void TestBoundaryConditions()
        {
            EvolutionModel model     = new EvolutionModel(0, 0);
            DnaBase        startBase = DnaBase.G;
            DnaBase        evolvedBase;

            for (int i = 0; i < numberOfInterations; i++)
            {
                evolvedBase = model.GenerateNextBase(startBase, i);
                Assert.AreEqual((int)startBase, (int)evolvedBase);
            }
        }
        private RnaBase PairOf(DnaBase dnaBase)
        {
            switch (dnaBase)
            {
            case DnaBase.A: return(RnaBase.U);

            case DnaBase.C: return(RnaBase.G);

            case DnaBase.G: return(RnaBase.C);

            case DnaBase.T: return(RnaBase.A);

            default: return(RnaBase.A);
            }
        }
示例#9
0
        public void TestImplicitConvertionFromInt()
        {
            DnaBase dnaBase = 1;

            Assert.AreEqual((string)dnaBase, "C");
        }