Coded approach in UiPath - Basics and Examples

Not sure how helpful this will be for you, but have you tried this approach?

    public class CodedTestCase : CodedWorkflow
    {
        [TestCase]
        public async Task<string> Execute(string in_fileUrl = "https://example-files.online-convert.com/document/txt/example.txt")
        {
            var downloadedFile = await system.DownloadFileFromURLAsync(in_fileUrl);
            Log(downloadedFile.LocalPath, LogLevel.Info);
            testing.VerifyAreEqual(System.IO.File.Exists("example.txt"), true);
            return downloadedFile.LocalPath;
        }
    }

Coded test cases are still coded workflows, so they have access to the registered services, which contain standard activities.
And since they’re coded workflows, they can be flipped to be async as well, which unlocks all the ones that don’t have a sync equivalent.

All that said, usually what is under test are workflows/some other code, so not sure how much it’s needed (unless it’s setup part, in which case fair game).

All that said, docs could use some love for the coded workflows and their subtypes. Both are I’d argue game changers (finally not everything has to be a visual bloated mess), and there’s quite a bit of improvements for them with each update, but it’s not easy to learn how to use them properly and when.