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


"""Test :py:method:`aas_core3.types.Class.descend_once`."""


# pylint: disable=missing-docstring


import unittest

import tests.common
import tests.common_jsonization


class Test_Extension(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_extension()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "Extension"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_AdministrativeInformation(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_administrative_information()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "AdministrativeInformation"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_Qualifier(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_qualifier()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "Qualifier"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_AssetAdministrationShell(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_asset_administration_shell()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "AssetAdministrationShell"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_AssetInformation(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_asset_information()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "AssetInformation"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_Resource(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_resource()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "Resource"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_SpecificAssetID(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_specific_asset_id()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "SpecificAssetId"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_Submodel(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_submodel()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "Submodel"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_RelationshipElement(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_relationship_element()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "RelationshipElement"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_SubmodelElementList(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_submodel_element_list()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "SubmodelElementList"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_SubmodelElementCollection(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_submodel_element_collection()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "SubmodelElementCollection"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_Property(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_property()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "Property"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_MultiLanguageProperty(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_multi_language_property()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "MultiLanguageProperty"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_Range(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_range()
        expected_path = (
            tests.common.TEST_DATA_DIR / "descend_once" / "Range" / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_ReferenceElement(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_reference_element()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "ReferenceElement"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_Blob(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_blob()
        expected_path = (
            tests.common.TEST_DATA_DIR / "descend_once" / "Blob" / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_File(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_file()
        expected_path = (
            tests.common.TEST_DATA_DIR / "descend_once" / "File" / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_AnnotatedRelationshipElement(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = (
            tests.common_jsonization.load_maximal_annotated_relationship_element()
        )
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "AnnotatedRelationshipElement"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_Entity(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_entity()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "Entity"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_EventPayload(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_event_payload()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "EventPayload"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_BasicEventElement(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_basic_event_element()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "BasicEventElement"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_Operation(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_operation()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "Operation"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_OperationVariable(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_operation_variable()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "OperationVariable"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_Capability(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_capability()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "Capability"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_ConceptDescription(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_concept_description()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "ConceptDescription"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_Reference(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_reference()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "Reference"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_Key(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_key()
        expected_path = (
            tests.common.TEST_DATA_DIR / "descend_once" / "Key" / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_LangStringNameType(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_lang_string_name_type()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "LangStringNameType"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_LangStringTextType(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_lang_string_text_type()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "LangStringTextType"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_Environment(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_environment()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "Environment"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_EmbeddedDataSpecification(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_embedded_data_specification()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "EmbeddedDataSpecification"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_LevelType(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_level_type()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "LevelType"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_ValueReferencePair(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_value_reference_pair()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "ValueReferencePair"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_ValueList(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_value_list()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "ValueList"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_LangStringPreferredNameTypeIEC61360(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = (
            tests.common_jsonization.load_maximal_lang_string_preferred_name_type_iec_61360()
        )
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "LangStringPreferredNameTypeIec61360"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_LangStringShortNameTypeIEC61360(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = (
            tests.common_jsonization.load_maximal_lang_string_short_name_type_iec_61360()
        )
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "LangStringShortNameTypeIec61360"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_LangStringDefinitionTypeIEC61360(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = (
            tests.common_jsonization.load_maximal_lang_string_definition_type_iec_61360()
        )
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "LangStringDefinitionTypeIec61360"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


class Test_DataSpecificationIEC61360(unittest.TestCase):
    def test_descend_once_against_recorded_trace_log(self) -> None:
        instance = tests.common_jsonization.load_maximal_data_specification_iec_61360()
        expected_path = (
            tests.common.TEST_DATA_DIR
            / "descend_once"
            / "DataSpecificationIec61360"
            / "maximal.json.trace"
        )

        log = [tests.common.trace(something) for something in instance.descend_once()]
        got_text = tests.common.trace_log_as_text_file_content(log)
        tests.common.record_or_check(expected_path, got_text)


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


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