示例#1
0
        public void SolveSecondPuzzle()
        {
            var sut = HydrothermalVentReport.CreateReportSupportingDiagonals(REAL_INPUT);

            Assert.Equal(21140, sut.CalculateAmountOfOverlappingPoints());
        }
示例#2
0
        public void CalculateOverlappingPointsCorrectly_WhenIncludingDiagonals()
        {
            var sut = HydrothermalVentReport.CreateReportSupportingDiagonals(SAMPLE_INPUT);

            Assert.Equal(12, sut.CalculateAmountOfOverlappingPoints());
        }
示例#3
0
        public void SupportDiagonalLines(string input, int expectedCount)
        {
            var sut = HydrothermalVentReport.CreateReportSupportingDiagonals(input);

            Assert.Equal(expectedCount, sut.CalculateAmountOfOverlappingPoints());
        }
示例#4
0
        public void CalculateOverlappingPoitnsCorrectly_WhenNotIncludingDiagonals(string input, int expectedCount)
        {
            var sut = HydrothermalVentReport.CreateReportNotSupportingDiagonals(input);

            Assert.Equal(expectedCount, sut.CalculateAmountOfOverlappingPoints());
        }
示例#5
0
        public void GenerateLinesCorrectly(string singleHorizontalLine, int expectedPoints)
        {
            var sut = HydrothermalVentReport.CreateReportNotSupportingDiagonals(singleHorizontalLine);

            Assert.Equal(expectedPoints, sut.CalculateAmountOfOverlappingPoints());
        }
示例#6
0
        public void BeInitializedCorrectly(string invalidReport)
        {
            var exception = Assert.Throws <ArgumentException>(() => HydrothermalVentReport.CreateReportNotSupportingDiagonals(invalidReport));

            Assert.Equal("Invalid input", exception.Message);
        }