Following is an example network path:
- it starts with `file://`
- the rest of the path is just the normal windows path
Because there is no "Unit Test Project" template for F#, we have to set it up ourselves:
A few years ago, MsTest had the Private Accessor feature, but it has been deprecated.
The apparent solution now is to use the `InternalsVisibleToAttribute` within your application code assembly:
After this, all our `internal` methods will be visible to the `MyProject.Tests` assembly.
Internet Explorer stores its favourites in the file system, with each link being a separate file.
In order to allow ourselves to access the same bookmarks within Firefox, we first navigate to favourites folder `file:///.../Favourites/` Within there, we can click on the `*.url` file links.
However, Chrome does not handle `*.url` files in the same way. It displays the textual contents of the `.url` file rather than following its URL. The solution is to implement a Tampermonkey script handling URLs ending in `.url`.
But first we must allow Tampermonkey access to the local file URLs. Below is the user script that handles `*.url` file extensions:
In my COM (Component Object Model) interface, I have a `Suggestions` property that is of the .NET type `string`; here is the COM type information (found using OLEView):
After invoking the getter:
we can first check if the array is empty by checking if the `_MaxIndex()` is `-1`:
If there are elements, then `_MaxIndex()` will return a value greater than or equal to `0`.
To get the last element, we pass the `_MaxIndex()` value to the indexer:
This is very simple, but one bit of code in which it does NOT work is using the indexer on the COM object's property:
For whatever reason, we must first evaluate `obj.Suggestions`, and then call the indexer. Therefore this works:
In general, when getting the array, because we are dealing with a copy of the data, if you are using this data multiple times in the code, it is best to assign it to variable before to avoid producing it multiple times.