This property allows to override default behavior of all function that require connection to cosmos. It is introduced to enable enhanced unit testing of modules that use VcClientVC.

Namespace: VcClient
Assembly: VcClient (in VcClient.dll) Version: 1.0.0.0 (1.8.400.4142)

Syntax

C#
public static VCOverride Override { get; }
Visual Basic
Public Shared ReadOnly Property Override As VCOverride
	Get
Visual C++
public:
static property VCOverride^ Override {
	VCOverride^ get ();
}

Examples

Production code:
CopyC#
class SomeClassTest
{
    public static bool MySetup()
    {
        try
        {
            VC.Setup("vc://cotest1/cosmosAdmin/", null, null);
            return true;
        }
        catch(HttpClientException)
        {
            return false;
        }
    }
}
Unit test code:
CopyC#
[TestClass()]
class SomeClassTest
{
    void SetupThrowingException(string vcName, string proxy, string userName)
    {
        throw new HttpClientException("");
    }

    [TestMethod()]
    public void MySetupTest()
    {
        // Override default VC.Setup
        // 
        VC.Override.Setup = SetupThrowingException;

        // Call method that calls VC.Setup;
        Assert.IsFalse(SomeClass.MySetup());
    }
}

See Also