Ejemplo n.º 1
0
        public void IsSelfcontainedTest(string input, bool expectedResult)
        {
            // Act
            var result = GarbageCollector.IsSelfcontained(input);

            // Assert
            Assert.AreEqual(expectedResult, result);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("+-------------------------+");
            Console.WriteLine("| Advent of Code - Day 09 |");
            Console.WriteLine("+-------------------------+");

            var input = File.ReadAllText("input.1.txt");

            var score = GarbageCollector.GetScore(input);

            Console.WriteLine($"Group score is {score}");

            var garbage = GarbageCollector.RemovedGarbage(input);

            Console.WriteLine($"Removed garbage is {garbage}");

            Console.WriteLine($" - Glædelig jul");
        }
Ejemplo n.º 3
0
        public void RemovedGarbageTest(string input, int removed)
        {
            var result = GarbageCollector.RemovedGarbage(input);

            Assert.That(result, Is.EqualTo(removed));
        }
Ejemplo n.º 4
0
        public void GetScoreTest(string input, int score)
        {
            var result = GarbageCollector.GetScore(input);

            Assert.That(result, Is.EqualTo(score));
        }
Ejemplo n.º 5
0
        public void RemoveGarbageTest(string input, string output)
        {
            var result = GarbageCollector.RemoveGarbage(input);

            Assert.That(result, Is.EqualTo(output));
        }