diff --git a/tests/unit/models/activities/control_activities/test_filter_activity.py b/tests/unit/models/activities/control_activities/test_filter_activity.py index c9a674be..d6deb734 100644 --- a/tests/unit/models/activities/control_activities/test_filter_activity.py +++ b/tests/unit/models/activities/control_activities/test_filter_activity.py @@ -1,3 +1,4 @@ +import pytest from azure_data_factory_testing_framework.models.activities.filter_activity import FilterActivity from azure_data_factory_testing_framework.models.data_factory_element import DataFactoryElement from azure_data_factory_testing_framework.models.pipeline import Pipeline @@ -5,7 +6,18 @@ from azure_data_factory_testing_framework.test_framework import TestFramework, TestFrameworkType -def test_filter_activity_on_range_of_values() -> None: +@pytest.mark.parametrize( + "input_values,expected_filtered_values", + [ + ([1, 2, 3, 4, 5], [1, 2, 3]), + ([], []), + ([4], []), + ([3, 4, 5, 6], [3]), + ([4, 5, 6], []), + ([-1, 3, 4], [-1, 3]), + ], +) +def test_filter_activity_on_range_of_values(input_values: [], expected_filtered_values: []) -> None: # Arrange test_framework = TestFramework(framework_type=TestFrameworkType.Fabric) pipeline = Pipeline( @@ -32,12 +44,12 @@ def test_filter_activity_on_range_of_values() -> None: activities = test_framework.evaluate_pipeline( pipeline, [ - RunParameter(RunParameterType.Pipeline, "input_values", [1, 2, 3, 4, 5]), + RunParameter(RunParameterType.Pipeline, "input_values", input_values), ], ) # Assert activity = next(activities) assert activity.type == "Filter" - assert activity.type_properties["items"].value == [1, 2, 3, 4, 5] - assert activity.output["value"] == [1, 2, 3] + assert activity.type_properties["items"].value == input_values + assert activity.output["value"] == expected_filtered_values