# This code has been automatically generated by:
# dev_scripts/test_codegen/generate_test_for_jsonization_of_classes_with_descendants.py
# Do NOT edit or append.


"""Test JSON de/serialization of classes with descendants."""


# pylint: disable=missing-docstring


import unittest

import aas_core3.jsonization as aas_jsonization

import tests.common
import tests.common_jsonization


class Test_Referable(unittest.TestCase):
    """
    Test round-trip JSON de/serialization over concrete descendants
    of :py:class:`aas_types.Referable`.
    """

    def test_round_trip_over_relationship_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_relationship_element()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_annotated_relationship_element(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_annotated_relationship_element()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_asset_administration_shell(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_asset_administration_shell()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_basic_event_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_basic_event_element()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_blob(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_blob()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_capability(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_capability()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_concept_description(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_concept_description()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_entity(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_entity()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_file(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_file()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_multi_language_property(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_multi_language_property()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_operation(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_operation()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_property(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_property()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_range(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_range()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_reference_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_reference_element()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_submodel(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_submodel()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_submodel_element_collection(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_collection()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_submodel_element_list(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_list()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.referable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_Identifiable(unittest.TestCase):
    """
    Test round-trip JSON de/serialization over concrete descendants
    of :py:class:`aas_types.Identifiable`.
    """

    def test_round_trip_over_asset_administration_shell(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_asset_administration_shell()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.identifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_concept_description(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_concept_description()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.identifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_submodel(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_submodel()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.identifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_Qualifiable(unittest.TestCase):
    """
    Test round-trip JSON de/serialization over concrete descendants
    of :py:class:`aas_types.Qualifiable`.
    """

    def test_round_trip_over_relationship_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_relationship_element()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_annotated_relationship_element(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_annotated_relationship_element()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_basic_event_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_basic_event_element()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_blob(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_blob()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_capability(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_capability()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_entity(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_entity()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_file(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_file()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_multi_language_property(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_multi_language_property()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_operation(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_operation()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_property(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_property()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_range(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_range()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_reference_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_reference_element()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_submodel(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_submodel()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_submodel_element_collection(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_collection()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_submodel_element_list(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_list()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.qualifiable_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_SubmodelElement(unittest.TestCase):
    """
    Test round-trip JSON de/serialization over concrete descendants
    of :py:class:`aas_types.SubmodelElement`.
    """

    def test_round_trip_over_relationship_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_relationship_element()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.submodel_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_annotated_relationship_element(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_annotated_relationship_element()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.submodel_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_basic_event_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_basic_event_element()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.submodel_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_blob(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_blob()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.submodel_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_capability(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_capability()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.submodel_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_entity(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_entity()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.submodel_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_file(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_file()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.submodel_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_multi_language_property(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_multi_language_property()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.submodel_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_operation(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_operation()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.submodel_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_property(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_property()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.submodel_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_range(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_range()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.submodel_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_reference_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_reference_element()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.submodel_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_submodel_element_collection(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_collection()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.submodel_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_submodel_element_list(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_submodel_element_list()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.submodel_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_RelationshipElement(unittest.TestCase):
    """
    Test round-trip JSON de/serialization over concrete descendants
    of :py:class:`aas_types.RelationshipElement`.
    """

    def test_round_trip_over_annotated_relationship_element(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_annotated_relationship_element()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.relationship_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_DataElement(unittest.TestCase):
    """
    Test round-trip JSON de/serialization over concrete descendants
    of :py:class:`aas_types.DataElement`.
    """

    def test_round_trip_over_blob(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_blob()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.data_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_file(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_file()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.data_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_multi_language_property(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_multi_language_property()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.data_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_property(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_property()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.data_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_range(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_range()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.data_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )

    def test_round_trip_over_reference_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_reference_element()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.data_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_EventElement(unittest.TestCase):
    """
    Test round-trip JSON de/serialization over concrete descendants
    of :py:class:`aas_types.EventElement`.
    """

    def test_round_trip_over_basic_event_element(self) -> None:
        concrete_instance = tests.common_jsonization.load_maximal_basic_event_element()
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.event_element_from_jsonable(jsonable)
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_DataSpecificationContent(unittest.TestCase):
    """
    Test round-trip JSON de/serialization over concrete descendants
    of :py:class:`aas_types.DataSpecificationContent`.
    """

    def test_round_trip_over_data_specification_iec_61360(self) -> None:
        concrete_instance = (
            tests.common_jsonization.load_maximal_data_specification_iec_61360()
        )
        jsonable = aas_jsonization.to_jsonable(concrete_instance)

        abstract_instance = aas_jsonization.data_specification_content_from_jsonable(
            jsonable
        )
        another_jsonable = aas_jsonization.to_jsonable(abstract_instance)

        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


if __name__ == "__main__":
    unittest.main()


# This code has been automatically generated by:
# dev_scripts/test_codegen/generate_test_for_jsonization_of_classes_with_descendants.py
# Do NOT edit or append.
