Example #1
0
        public void Run()
        {
            var input  = AuxiliarMethods.ReadFiles("StrongPassword", true);
            var output = AuxiliarMethods.ReadFiles("StrongPassword", false);

            for (int i = 0; i < input.Count; i++)
            {
                string[] split = input[i].Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);
                AuxiliarMethods.Assert("StrongPassword", i, strongPassword(Convert.ToInt32(split[0]), split[1]), output[i].Replace("\n", string.Empty));
            }
        }
Example #2
0
        public void Run()
        {
            var input  = AuxiliarMethods.ReadFiles("RepeatedStrings", true);
            var output = AuxiliarMethods.ReadFiles("RepeatedStrings", false);

            for (int i = 0; i < input.Count; i++)
            {
                string[] split = input[i].Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);
                AuxiliarMethods.Assert("RepeatedStrings", i, NumberOfRepeatedAs(split[0], Convert.ToInt64(split[1])), output[i]);
            }
        }
Example #3
0
        public void Run()
        {
            var input  = AuxiliarMethods.ReadFiles("SockMerchant", true);
            var output = AuxiliarMethods.ReadFiles("SockMerchant", false);

            for (int i = 0; i < input.Count; i++)
            {
                string[] split  = input[i].Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);
                var      result = SockerMerchant(Array.ConvertAll(split[1].Split(' '), arrTemp => Convert.ToInt32(arrTemp)));
                AuxiliarMethods.Assert("SockMerchant", i, result, output[i]);;
            }
        }
Example #4
0
        public void Run()
        {
            var input  = AuxiliarMethods.ReadFiles("GradingStudents", true);
            var output = AuxiliarMethods.ReadFiles("GradingStudents", false);

            for (int i = 0; i < input.Count; i++)
            {
                string[] split = input[i].Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);
                var      list  = new List <int>();
                for (int j = 1; j < split.Length; j++)
                {
                    list.Add(Convert.ToInt32(split[j]));
                }
                AuxiliarMethods.Assert("GradingStudents", i, string.Join("\n", gradingStudents(list)), output[i]);
            }
        }
Example #5
0
        public void Run()
        {
            var input  = AuxiliarMethods.ReadFiles("IceCreamParlor", true);
            var output = AuxiliarMethods.ReadFiles("IceCreamParlor", false);

            for (int i = 0; i < input.Count; i++)
            {
                string[] split           = input[i].Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);
                int      numberOfTrips   = Convert.ToInt32(split[0]);
                var      result          = new List <string>();
                int      readingPosition = 1;
                for (int j = 0; j < numberOfTrips; j++)
                {
                    var tmpResult = iceCreamParlor(Convert.ToInt32(split[readingPosition]), Array.ConvertAll(split[readingPosition + 2].Split(' '), arrTemp => Convert.ToInt32(arrTemp)));
                    result.Add(string.Join(" ", tmpResult.Select(p => p.ToString()).ToArray()));
                    readingPosition += 3;
                }
                AuxiliarMethods.Assert("IceCreamParlor", i, string.Join("\n", result), output[i]);
            }
        }