Exemplo n.º 1
0
    public static void Y2016_Day10_GetBotNumber_Returns_Correct_Solution()
    {
        // Arrange
        string[] instructions = new[]
        {
            "value 5 goes to bot 2",
            "bot 2 gives low to bot 1 and high to bot 0",
            "value 3 goes to bot 1",
            "bot 1 gives low to output 1 and high to bot 0",
            "bot 0 gives low to output 2 and high to output 0",
            "value 2 goes to bot 2",
        };

        int[] binsOfInterest = new[] { 0, 1, 2 };

        // Act
        (int bot, int product) = Day10.GetBotNumber(instructions, 5, 2, binsOfInterest);

        // Assert
        bot.ShouldBe(2);
        product.ShouldBe(30);
    }