Esempio n. 1
0
        public void DayFive_PartOne_ReturnsNumberOfSteps()
        {
            var input      = File.ReadAllLines($"{inputsPrefix}Day5.txt");
            var collection = new InstructionSetDaySix(input);

            collection.PerformInstructionsPartOne();

            Assert.Equal(343364, collection.StepsTaken);
        }
Esempio n. 2
0
        public void DayFive_PartTwo_ReturnsNumberOfStepsWithPossibleDecreaseInOffset()
        {
            var input      = File.ReadAllLines($"{inputsPrefix}Day5.txt");
            var collection = new InstructionSetDaySix(input);

            collection.PerformInstructionsPartTwo();

            Assert.Equal(25071947, collection.StepsTaken);
        }
        public void PerformInstructionsPartOneShould_CountSteps()
        {
            var collection = new InstructionSetDaySix(input);

            collection.PerformInstructionsPartOne();

            Assert.Equal(4, collection.StepsTaken);
            Assert.NotEqual(0, collection.TargetIndex);
            Assert.NotEqual(0, collection.ActiveIndex);
        }
        public void ConstructorShould_ReturnInstructionSetWithPopulatedIntArray()
        {
            var collection = new InstructionSetDaySix(input);

            Assert.Equal(0, collection.TargetIndex);
            Assert.Equal(0, collection.ActiveIndex);
            Assert.Equal(0, collection.StepsTaken);
            Assert.IsType <int[]>(collection.Instructions);
            Assert.Equal(input.Length, collection.Instructions.Length);
        }
        public void PerformInstructionsPartTwoShould_CountStepsWithDecrementIfOffsetOverThree()
        {
            var collection = new InstructionSetDaySix(inputTwo);

            collection.PerformInstructionsPartTwo();

            Assert.Equal(24, collection.StepsTaken);

            var oneCollection = new InstructionSetDaySix(inputTwo);

            oneCollection.PerformInstructionsPartOne();
            Assert.Equal(12, oneCollection.StepsTaken);
        }