currently I want to test some processes of a bot I created, which was written in C#, and one of these processes has an argument with the type UiPath.MicrosoftOffice365.Models.Office365Message.
I would like to test this specific process independently, therefore I want to create a new object of said type.
The problem is I can’t.
There doesn’t seem to be a developer doc for these kind of things, so I don’t know if there is even a constructor, and all my attempts to create a new object failed.
I also tried to cast a System.Net.Mail.MailMessage object to …Office365Message, but that didn’t work. I guess because System.Net.Mail.MailMessage is a subtype of …Office365Message.
I tried to cast it with “(…Office365Message) new System.Net.Mail.MailMessage” and also with “as”, but neither did work.
So my question is the following: How can I create a new object of type “UiPath.MicrosoftOffice365.Models.Office365Message” in a C# Project?
This question was already asked a couple of times over the years [topic1][topic2][topic3], but none of them were really answered, and they also targeted VB instead of C#.
The blocks which I commented out are validation errors
Then I do not receive any error in the Assignment or Conversion.
Did you also run the bot? Because I am always getting a runtime error, independent of if the package is a stable one or a preview.
The screenshot above is with the same packages as you have in your screenshot
That’s my last resort, and I will do that if there is no other solution.
But to why I don’t want that: I would like to have as few dependencies as possible, and the process I want to test doesn’t interact with outlook or the microsoft servers. It only needs the data which is stored in the mail object
No New dependency has to be loaded…as office365 mail objetc comes from same dependency as the get mail activity of office 365…Ideally we get mail object after interacting only…may be it is a different bot I guess
creating a office365 mail Object I dont think is directly possible with values.
Never the less if you are able to achieve some way would really appreciate sharing it across…
Sorry for the confusion, I didn’t mean a UiPath dependency, but instead an external dependency so to say.
The problem with the get mail activity is that I would need to have a valid outlook account specified and there must also be a test email in this account.
That I would like to avoid.
In my best case scenario I create a Office365Message object with the necessary data (which by the way works with System.Net.Mail.MailMessage) and then give it to the process and look if the process did everything correct.
No Outlook involved and I can save all the testdata in the bot itself, therefore no unnecessary dependecies