public void ValidateClone() { var options1 = new ArmClientOptions(); var options2 = options1.Clone(); Assert.IsFalse(ReferenceEquals(options1, options2)); Assert.IsFalse(ReferenceEquals(options1.Diagnostics, options2.Diagnostics)); Assert.IsFalse(ReferenceEquals(options1.Retry, options2.Retry)); Assert.IsFalse(ReferenceEquals(options1.ApiVersions, options2.ApiVersions)); }
public void TestTransportInClone() { var x = new ArmClientOptions(); x.Transport = new MyTransport(); var y = x.Clone(); Assert.IsTrue(ReferenceEquals(x.Transport, y.Transport)); x.Transport = new MyTransport(); Assert.IsFalse(ReferenceEquals(y.Transport, x.Transport)); }
public void ValidateOptionsTestApiVersions() { var x = new ArmClientOptions(); var y = x.Clone(); Assert.IsFalse(ReferenceEquals(x.ApiVersions, y.ApiVersions)); Assert.AreEqual(x.ApiVersions.TryGetApiVersion("{Microsoft.Resources/subscriptions/resourceGroups}"), y.ApiVersions.TryGetApiVersion("{Microsoft.Resources/subscriptions/resourceGroups}")); x.ApiVersions.SetApiVersion("{Microsoft.Resources/subscriptions/resourceGroups}", "1500-10-10"); Assert.IsFalse(ReferenceEquals(x.ApiVersions, y.ApiVersions)); Assert.AreNotEqual(x.ApiVersions, y.ApiVersions); }