async def METHOD_NAME(mock_resolver, side_effect, error):
    mock_resolver.resolve_with_metadata = async_mock.CoroutineMock(
        side_effect=side_effect()
    )
    profile = InMemoryProfile.test_profile()
    context = profile.context
    setattr(context, "profile", profile)
    session = await profile.session()
    session.context.injector.bind_instance(DIDResolver, mock_resolver)
    outbound_message_router = async_mock.CoroutineMock()
    request_dict = {
        "context": context,
        "outbound_message_router": outbound_message_router,
    }
    request = async_mock.MagicMock(
        match_info={
            "did": "did:ethr:mainnet:0xb9c5714089478a327f09197987f16f9e5d936e8a",
        },
        query={},
        json=async_mock.CoroutineMock(return_value={}),
        __getitem__=lambda _, k: request_dict[k],
    )
    with async_mock.patch.object(
        context.profile,
        "session",
        async_mock.MagicMock(return_value=session),
    ) as mock_session:
        with pytest.raises(error):
            await test_module.resolve_did(request)