コード例 #1
0
 static void Main(string[] args)
 {
     int[] requests = new int[1000];
     Algorithms Handler = new Algorithms();
     Handler.GenerateRequests(ref requests);
     Console.WriteLine("Algo \tSeek Distance\n");
     Console.WriteLine("FCFS \t" + Handler.FCFS(requests).ToString());
     Console.WriteLine("SSTF \t" + Handler.SSTF(requests).ToString());
     Console.WriteLine("SCAN \t" + Handler.SCAN(requests).ToString());
     Console.WriteLine("CSCAN\t" + Handler.CSCAN(requests).ToString());
     Console.WriteLine("LOOK \t" + Handler.LOOK(requests).ToString());
     Console.WriteLine("CLOOK\t" + Handler.CLOOK(requests).ToString());
 }
コード例 #2
0
        public void TesterTwo()
        {
            Algorithms Tester = new Algorithms();

            int[] SmallTest = { 1, 2, 3, 4, 5 };

            int result = Tester.FCFS(SmallTest, 5);
            int compare = 5;

            Assert.AreEqual(compare, result, "Correct Output");
        }
コード例 #3
0
        public void TesterOne()
        {
            Algorithms Tester = new Algorithms();

            int[] SmallTest = { 10, 5, 0, 5, 10 };

            int result = Tester.FCFS(SmallTest, 5);
            int compare = 30;

            Assert.AreEqual(compare, result, "Correct Output");
        }
コード例 #4
0
        public void TesterAllSameNumber()
        {
            Algorithms Tester = new Algorithms();

            int[] SmallTest = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };

            int result = Tester.FCFS(SmallTest, 14);
            int compare = 1;

            Assert.AreEqual(compare, result, "Correct Output");
        }