public void TestImplicitIntConvertion() { DnaBase dnaBase = new DnaBase(DnaBase.DnaBaseEnumeration.G); int dnaBaseAsInt = dnaBase; Assert.AreEqual(dnaBaseAsInt, (int)DnaBase.DnaBaseEnumeration.G); }
public void TestImplicitStringConvertion() { DnaBase dnaBase = new DnaBase(DnaBase.DnaBaseEnumeration.A); string dnaStringRepresentation = dnaBase; Assert.AreEqual(dnaStringRepresentation, "A"); }
public void TestConvertionToString() { DnaBase dnaBase = new DnaBase(DnaBase.DnaBaseEnumeration.A); string dnaStringRepresentation = dnaBase.ToString(); Assert.AreEqual(dnaStringRepresentation, "A"); }
public void TestElementAt() { DnaSequence dnaSequence = new DnaSequence("ACGT"); DnaBase dnaBase = dnaSequence.ElementAt(1); Assert.AreEqual('C', (char)dnaBase); }
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); }
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); }
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); } }
public void TestImplicitConvertionFromInt() { DnaBase dnaBase = 1; Assert.AreEqual((string)dnaBase, "C"); }