summaryrefslogtreecommitdiffstats
path: root/day1/test_init.py
blob: a24e272ada8850c144f6fbb06cdaf7f933df8c3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# -*- coding: utf-8 -*-
import pytest

from day1 import AssignmentTwo


class TestAssignmentTwo:
    data = [
        # Example Data
        (50, -68, 82, 1),
        (82, -30, 52, 0),
        (52, 48, 0, 1),
        (0, -5, 95, 0),
        (95, 60, 55, 1),
        (55, -55, 0, 1),
        (0, -1, 99, 0),
        (99, -99, 0, 1),
        (0, 14, 14, 0),
        (14, -82, 32, 1),
        # Additional cases
        (0, 10, 10, 0),
        (0, -10, 90, 0),
        (0, 100, 0, 1),
        (0, -100, 0, 1),
        (80, 40, 20, 1),
        (80, 140, 20, 2),
        (80, 100, 80, 1),
        (0, -300, 0, 3),
        (0, 299, 99, 2),
        (0, -299, 1, 2),
    ]

    @pytest.mark.parametrize("position,rotation,new_position,seen_0", data)
    def test_calculate_new_position(self, position, rotation, new_position, seen_0):
        assert AssignmentTwo.calculate_new_position(position, rotation) == (
            new_position,
            seen_0,
        )