Exemplo n.º 1
0
        public void TestsWithInputFromFiles(string fileName, int expectedResult)
        {
            int[] input;
            using (var streamReader = new StreamReader(@"..\..\Week 1 Inversion Counting\" + fileName))
            {
                var line = streamReader.ReadToEnd();
                input = line.Split(new[] { "\n" }, StringSplitOptions.RemoveEmptyEntries)
                        .Select(int.Parse).ToArray();
            }

            var result = InversionCountingImpl.Count(input);

            Assert.AreEqual(expectedResult, result);
        }
Exemplo n.º 2
0
        public void Tests(int[] input, int expectedResult)
        {
            var result = InversionCountingImpl.Count(input);

            Assert.AreEqual(expectedResult, result);
        }