Implement abstract class not possible

For my unittests I want to use Moles to run the tests outside the Windows Azure development factory. By making a mole assembly for Microsoft.WindowsAzure.ServiceRuntime I would be on my way. But I’m getting strange error messages: there is no stub being generated for Microsoft.WindowsAzure.ServiceRuntime.RoleInstance and I cannot implement it myself.

public abstract class RoleInstance
    {
        public abstract int FaultDomain { get; }
        public abstract string Id { get; }
        public abstract IDictionary<string, RoleInstanceEndpoint> InstanceEndpoints { get; }
        public abstract Role Role { get; }
        public abstract int UpdateDomain { get; }
    }

The object contains only property get operations and is defined as an abstract class. Implementing the property get operations gives me error messages about not implementing the property set operations. Implementing the property set operations gives me error messages error messages about the property set operations not being defined in the (abstract) base class and cannot be overwritten.
[/edit]
I used Reflector to look at te code. I noticed every property had an internal set operation. Looks like the compiler wants to do something with this, bus doesn’t know what. That explains the error messages. Maybe my post with Microsoft resolves this issue.
[/edit]
Peli admits this is a strange situation and sees no resolution in Moles in the near future. So for now no Moles for Windows Azure.

About erictummers

My work as a recruited developer changes almost every month. I like challenges and sharing the solutions with others. On my blog I’ll mostly post about my work, but expect an occasional home project, productivity tip and tooling review.
This entry was posted in Test and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s