ICouchbaseCluster is a internal interface/Cluster class is sealed? (SDK 2.0)

Hey there,

I am making my own abstraction layer to utilise version 2.0 beta of the .NET SDK.
I noticed one of the key interfaces, ICouchbaseCluser is internal to the core namespace and the class which inherits this is also a sealed class?

I can’t unit test the functionality properly which utilises this interface/class, even using Mocking Frameworks, as they require an interface or abstract class, which both are inaccessible to my testing namespace.

I have tried creating my own cluster class using inheritance but Cluster is a sealed class, and again, I can’t access the internal interface to do it that way either.

Any chance this can be sorted asap?




As you have probably guessed this was not done by accident! That being said, I completely understand your dilemma; how to mock the root object? The problem is that in any public API certain things should be exposed and available and other things are better left abstracted/encapsulated from the user of the API. Early on I made this internal, but I think your right it might be a better as a public interface given your feedback.

Can you create a Jira ticket for this feature? http://couchbase.com/issues/ncbc

Note the test project (Couchbase.Tests) is a friend assembly and the ICouchbaseCluster (another note: expect a name change to ICluster before GA) interface can be mocked from there (a weak attempt at soliciting a contribution to the project ;)).



Hi J,

Yeah I understood why it may be internal, but obviously as you say, it would be a better move forward to make it publicly available :smile:

I have created a JIRA issue for you, thanks for getting back so quickly!