示例#1
0
        public void Run()
        {
            Console.WriteLine("Choose file:"); // Prompt
            Console.WriteLine("1 - abra.txt"); // Prompt
            Console.WriteLine("or quit");      // Prompt

            var fileNumber = Console.ReadLine();
            var fieName    = string.Empty;

            switch (fileNumber)
            {
            case "1":
                fieName = "abra.txt";
                break;

            case "quit":
                return;

            default:
                return;
            }


            var @in        = new In($"Files\\Strings\\{fieName}");
            var content    = @in.ReadAll();
            var binaryDump = new BinaryDump(content, 16);

            binaryDump.Dump();

            Console.ReadLine();
        }
示例#2
0
 public void ReadAllFromUrl()
 {
     using (In inObject = new In(UrlName))
      {
     string s = inObject.ReadAll();
     Assert.AreEqual(InUnitTests.InTest, s);
      }
 }
示例#3
0
        public void Run()
        {
            Console.WriteLine("Choose file:"); // Prompt
            Console.WriteLine("1 - abra.txt"); // Prompt
            Console.WriteLine("2 - pi.txt");   // Prompt
            Console.WriteLine("or quit");      // Prompt

            var fileNumber = Console.ReadLine();
            var alpha      = string.Empty;
            var fieName    = string.Empty;

            switch (fileNumber)
            {
            case "1":
                fieName = "abra.txt";
                alpha   = "ABCDR";
                break;

            case "2":
                fieName = "pi.txt";
                alpha   = "0123456789";
                break;

            case "quit":
                return;

            default:
                return;
            }


            var @in     = new In($"Files\\Strings\\{fieName}");
            var content = @in.ReadAll();

            var count = new Count(alpha);

            count.Run(content);


            Console.ReadLine();
        }
示例#4
0
        public void Run()
        {
            Console.WriteLine("Choose file:");        // Prompt
            Console.WriteLine("1 - genomeTiny.txt");  // Prompt
            Console.WriteLine("2 - genomeVirus.txt"); // Prompt
            Console.WriteLine("or quit");             // Prompt

            var fileNumber = Console.ReadLine();
            var fieName    = string.Empty;

            switch (fileNumber)
            {
            case "1":
                fieName = "genomeTiny.txt";
                break;

            case "2":
                fieName = "genomeVirus.txt";
                break;

            case "quit":
                return;

            default:
                return;
            }


            var @in     = new In($"Files\\Strings\\{fieName}");
            var content = @in.ReadAll();
            var genome  = new Genome();

            genome.Compress(content);
            genome.Expand();


            Console.ReadLine();
        }