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.
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.
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

Working in a DevOps team is the best thing that happened to me. 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: Logo

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

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.