Exemple #1
0
        // [Test, TestCaseSource(typeof(TestCaseFactory), "ScheduleCases")]
        public void CanCalculateCompletionTimes(string inputFile, string outputFile)
        {
            var times  = ScheduleLoader.CalculateWeightedCompletionTime(inputFile);
            var actual = File.ReadLines(outputFile).WhereNotNull().Select(long.Parse);

            Assert.AreEqual(actual.Last(), times.optimal, message: "optimal check failed");
            Assert.AreEqual(actual.First(), times.poor, message: "poor check failed");
        }
Exemple #2
0
        static void Main(string[] args)
        {
            var times = ScheduleLoader.CalculateWeightedCompletionTime("schedule_data.txt");

            Console.WriteLine($"poor: {times.poor}, optimal: {times.optimal}");
        }