Esempio n. 1
0
        public void HackerrankTest8()
        {
            InputDataMedianUpdate oData = GetInputData(_sTestDataRootDir + "hackerrank8_input.txt");

            string[] result   = MedianUpdates.medianTest(oData.actions, oData.heapArgs);
            string[] expected = GetAnswerData(_sTestDataRootDir + "hackerrank8_answer.txt", oData.actions.Length);
            CollectionAssert.AreEqual(expected, result);
        }
Esempio n. 2
0
        public void sample1Test()
        {
            InputDataMedianUpdate oData = GetInputData(_sTestDataRootDir + "sample1_input.txt");

            //var type = typeof(MedianUpdates);
            //MethodInfo method = type.GetMethods(BindingFlags.NonPublic | BindingFlags.Instance)
            //                .Where(x => x.Name == "ProcessHeapCommands" && x.IsPrivate)
            //                .FirstOrDefault();

            //if (method == null) Assert.Fail("Could not instance of MedianUpdate class.");
            //string[] result = (string[])method.Invoke(null, new object[] { oData.actions, oData.heapArgs });

            string[] result   = MedianUpdates.medianTest(oData.actions, oData.heapArgs);
            string[] expected = GetAnswerData(_sTestDataRootDir + "sample1_answer.txt", oData.actions.Length);
            CollectionAssert.AreEqual(expected, result);
        }