# coding: utf-8

"""
    OneRoster OpenAPI (JSON) Definition

    The OneRoster service binding is available in WSDL/XSD and REST/JSON. The model is based upon the IMS PSM modelling approach.  # noqa: E501

    OpenAPI spec version: 1.1
    Contact: lmattson@imsglobal.org
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import unittest

import oneroster_client
from oneroster_client import ApiClient
from oneroster_client.models.result_type import ResultType  # noqa: E501
from oneroster_client.rest import ApiException
from test.fake_response import FakeResponse


class TestResultType(unittest.TestCase):
    """ResultType unit test stubs"""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def testResultType(self):
        """Test ResultType"""
        # FIXME: construct object with mandatory attributes with example values
        # model = oneroster_client.models.result_type.ResultType()  # noqa: E501
        pass

    def test_it_deserializes_score_correctly(self):
        api_client = ApiClient()
        result_str = """
        {
            "sourcedId": "c62cf45c-678a-470a-8270-6898eb03f3bc",
            "status": "active",
            "dateLastModified": "2021-12-21T21:32:42.000Z",
            "metadata": {
                "StrongMind": {
                    "last_activity_at": "2021-12-17T04:12:21.000Z",
                    "total_activity_time": 105139
                }
            },
            "lineItem": {
                "href": "https://api.platform.strongmind.com/ims/oneroster/v1p1/lineItems/7a7a71b5-ca10-4bb7-8339-ac3aa1319afc",
                "sourcedId": "7a7a71b5-ca10-4bb7-8339-ac3aa1319afc",
                "type": "lineItem"
            },
            "student": {
                "href": "https://api.platform.strongmind.com/ims/oneroster/v1p1/students/56b6bd11-244e-4386-b8c6-a12068a0a16c",
                "sourcedId": "56b6bd11-244e-4386-b8c6-a12068a0a16c",
                "type": "user"
            },
            "scoreStatus": "fully graded",
            "score": 85.78,
            "scoreDate": "2021-12-21T21:32:42.000Z"
        }
        """
        res = FakeResponse()
        res.data = result_str
        result = api_client.deserialize(res, "ResultType")
        assert result.score == 85.78


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