Coded approach in UiPath - Basics and Examples

Thank you for your reply.

Decompiling activities is a good idea, I will try that with dotPeek. I was just not able to find the DLL with the activities, could you give me a hint, how can I locate the referenced DLLs in my project?

So far, I was able to use the xaml file to get all the required namespaces and C# classes, which is a good start, but I am missing the part, on how to work with OutArguments.

This is what I have so far:

    public class TestCase_C : CodedWorkflow
    {
        [TestCase]
        public void Execute(string in_fileUrl = "https://example-files.online-convert.com/document/txt/example.txt")
        {
            var downloadFile = new UiPath.Activities.System.FileOperations.DownloadFileFromUrl 
            {
                Url = in_fileUrl                
            };
            
            var invoker = new WorkflowInvoker(downloadFile);
            var result = invoker.Invoke();
            
            var localItem = result[nameof(downloadFile.ResponseAttachment)] as UiPath.Core.Activities.FileSystemLocalItem;
            var localPath = localItem.LocalPath;
        }
    }

I was able to get the LocalPath by manually casting the first Value from the result Dictionary and getting the value using nameof. This feels not correct. I would actually expect to do it like this:

    // LocalPath does not exist
    var localPath = downloadFile.ResponseAttachment.LocalPath;

or like this

    var activityContext = // how???
    var localPath = downloadFile.ResponseAttachment.Get<UiPath.Core.Activities.FileSystemLocalItem>(activityContext);

How do I get access to activityContext in a TestCase?