couchbase/couchbase-net-client — pull request #6 by jeffrymorris (2013-08-08 05:55:34+00:00)
Title: Unit test fix and refactoring

I noticed a couple of unit tests were failing consistently and this one (CouchbaseAuthenticatedViewTests.cs) one stood out as needed refactoring - it was inheriting a base class, but not using any of the base functionality and was not disposing the client after each test. CouchbaseClient has a Dispose method from IMemcachedClient which should be called to cleanup resources - (MemcachedClient has a finalizer that will eventually be called, however).

The test was also failing because it was trying to test for the presence of data, which you really do not need - the call itself just needs to execute with throwing an InvalidOperationException. As a side note, shouldn't the exception be some sort of security or not authenticated exception?

While feel that this fix is an improvement over the previous test, I don't feel that the test is particularly strong. It's brittle and requires quite a bit of setup before getting it to run. More improvements could be made to overall structure.