Exemplo n.º 1
0
        public void GetGreedySCS_FinalResult()
        {
            //Arrange
            string[]      input       = { "all is well", "ell that en", "hat end", "t ends well" };
            List <string> collection  = new List <string>(input);
            string        expectedSCS = "all is well that ends well";

            //Act
            GenomeSequencing.GreedySCS greedySCS = new GenomeSequencing.GreedySCS(collection);
            string result = greedySCS.GetGreedySCS();

            //Assert
            Assert.AreEqual(expectedSCS, result);
        }
Exemplo n.º 2
0
        public void GetGreedySCS_ResultContainsAllSubstrings()
        {
            //Arrange
            string[]      input       = { "all is well", "ell that en", "hat end", "t ends well" };
            List <string> collection  = new List <string>(input);
            string        expectedSCS = "all is well that ends well";

            //Act
            GenomeSequencing.GreedySCS greedySCS = new GenomeSequencing.GreedySCS(collection);
            string result = greedySCS.GetGreedySCS();

            //Assert
            foreach (var fragment in collection)
            {
                Assert.IsTrue(expectedSCS.Contains(fragment));
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Console.WriteLine("start");

            //hardcode input for now
            string[] input = { "all is well", "ell that en", "hat end", "t ends well" };
            //string[] input = { "actgag", "tcctagga", "gctctaaatcgctat", "cgtacgtac", "gtcttctatct", "actg", "agt", "cctaggagctc", "taaatcgct", "a", "tcgta", "cgtacgt", "cttctatct", "actgagt", "cctaggagctc", "taaatcg", "ctatcgtacgtacgtct", "tctatct", "actga", "gtcctaggagc", "tctaaatcgctat", "cgtacgtacgtc", "ttctatct", "actg", "agtcctaggagctctaaat", "cgctatcgtacgtacg", "tcttct", "atct", "actgagtcctaggagc", "tctaaatcgctatcgta", "cgtacgtcttctatct", "actgagt", "cctaggag", "ctctaaat", "cgctatcg", "tacgtacgt", "cttctatct"};
            List <string> origCollection = new List <string>(input);

            Console.WriteLine(string.Join("\n", origCollection.ToArray()));

            GreedySCS greedySCS = new GreedySCS(origCollection);
            string    result    = greedySCS.GetGreedySCS();

            Console.WriteLine(result);

            Console.WriteLine("Finish");
        }
Exemplo n.º 4
0
        public void GetGreedySCS_ResultContainsAllSubstringsLargerInputSize()
        {
            //created a 50char dna string and created multiple copies then cut each randomly and set as input collection.

            //Arrange
            string[]      input       = { "actgag", "tcctagga", "gctctaaatcgctat", "cgtacgtac", "gtcttctatct", "actg", "agt", "cctaggagctc", "taaatcgct", "a", "tcgta", "cgtacgt", "cttctatct", "actgagt", "cctaggagctc", "taaatcg", "ctatcgtacgtacgtct", "tctatct", "actga", "gtcctaggagc", "tctaaatcgctat", "cgtacgtacgtc", "ttctatct", "actg", "agtcctaggagctctaaat", "cgctatcgtacgtacg", "tcttct", "atct", "actgagtcctaggagc", "tctaaatcgctatcgta", "cgtacgtcttctatct", "actgagt", "cctaggag", "ctctaaat", "cgctatcg", "tacgtacgt", "cttctatct" };
            List <string> collection  = new List <string>(input);
            string        expectedSCS = "actgagtcctaggagctctaaatcgctatcgtacgtacgtcttctatct";

            //Act
            GenomeSequencing.GreedySCS greedySCS = new GenomeSequencing.GreedySCS(collection);
            string result = greedySCS.GetGreedySCS();

            //Assert
            foreach (var fragment in collection)
            {
                Assert.IsTrue(expectedSCS.Contains(fragment));
            }
        }