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


"""Test de/serialization from JSON of concrete classes outside a container."""


# pylint: disable=missing-docstring


import unittest

import aas_core3.jsonization as aas_jsonization

import tests.common
import tests.common_jsonization


class Test_Extension(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_extension()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.extension_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_AdministrativeInformation(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_administrative_information()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.administrative_information_from_jsonable(
            jsonable
        )

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_Qualifier(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_qualifier()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.qualifier_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_AssetAdministrationShell(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_asset_administration_shell()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.asset_administration_shell_from_jsonable(
            jsonable
        )

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_AssetInformation(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_asset_information()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.asset_information_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_Resource(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_resource()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.resource_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_SpecificAssetID(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_specific_asset_id()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.specific_asset_id_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_Submodel(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_submodel()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.submodel_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_RelationshipElement(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_relationship_element()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.relationship_element_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_SubmodelElementList(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_submodel_element_list()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.submodel_element_list_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_SubmodelElementCollection(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_submodel_element_collection()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.submodel_element_collection_from_jsonable(
            jsonable
        )

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_Property(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_property()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.property_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_MultiLanguageProperty(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_multi_language_property()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.multi_language_property_from_jsonable(
            jsonable
        )

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_Range(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_range()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.range_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_ReferenceElement(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_reference_element()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.reference_element_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_Blob(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_blob()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.blob_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_File(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_file()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.file_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_AnnotatedRelationshipElement(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = (
            tests.common_jsonization.load_maximal_annotated_relationship_element()
        )

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.annotated_relationship_element_from_jsonable(
            jsonable
        )

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_Entity(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_entity()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.entity_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_BasicEventElement(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_basic_event_element()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.basic_event_element_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_Operation(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_operation()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.operation_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_OperationVariable(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_operation_variable()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.operation_variable_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_Capability(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_capability()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.capability_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_ConceptDescription(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_concept_description()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.concept_description_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_Reference(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_reference()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.reference_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_Key(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_key()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.key_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_LangStringNameType(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_lang_string_name_type()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.lang_string_name_type_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_LangStringTextType(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_lang_string_text_type()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.lang_string_text_type_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_EmbeddedDataSpecification(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_embedded_data_specification()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.embedded_data_specification_from_jsonable(
            jsonable
        )

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_LevelType(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_level_type()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.level_type_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_ValueReferencePair(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_value_reference_pair()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.value_reference_pair_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_ValueList(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_value_list()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.value_list_from_jsonable(jsonable)

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_LangStringPreferredNameTypeIEC61360(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = (
            tests.common_jsonization.load_maximal_lang_string_preferred_name_type_iec_61360()
        )

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = (
            aas_jsonization.lang_string_preferred_name_type_iec_61360_from_jsonable(
                jsonable
            )
        )

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_LangStringShortNameTypeIEC61360(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = (
            tests.common_jsonization.load_maximal_lang_string_short_name_type_iec_61360()
        )

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = (
            aas_jsonization.lang_string_short_name_type_iec_61360_from_jsonable(
                jsonable
            )
        )

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_LangStringDefinitionTypeIEC61360(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = (
            tests.common_jsonization.load_maximal_lang_string_definition_type_iec_61360()
        )

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = (
            aas_jsonization.lang_string_definition_type_iec_61360_from_jsonable(
                jsonable
            )
        )

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        self.assertListEqual(
            [],
            list(
                map(
                    str,
                    tests.common_jsonization.check_equal(jsonable, another_jsonable),
                )
            ),
        )


class Test_DataSpecificationIEC61360(unittest.TestCase):
    def test_round_trip(self) -> None:
        instance = tests.common_jsonization.load_maximal_data_specification_iec_61360()

        jsonable = aas_jsonization.to_jsonable(instance)

        another_instance = aas_jsonization.data_specification_iec_61360_from_jsonable(
            jsonable
        )

        another_jsonable = aas_jsonization.to_jsonable(another_instance)

        # Check the round-trip
        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_concrete_classes_outside_container.py
# Do NOT edit or append.
