Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove default location from armclientoptions #22633

Merged
merged 5 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,10 @@ public sealed class ArmClientOptions : ClientOptions
/// Initializes a new instance of the <see cref="ArmClientOptions"/> class.
/// </summary>
public ArmClientOptions()
: this(Location.Default)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="ArmClientOptions"/> class.
/// </summary>
/// <param name="defaultLocation"> The default location to use if can't be inherited from parent. </param>
public ArmClientOptions(Location defaultLocation)
{
if (defaultLocation is null)
throw new ArgumentNullException(nameof(defaultLocation));

DefaultLocation = defaultLocation;
ApiVersions = new ApiVersions(this);
}

/// <summary>
/// Gets the default location to use if can't be inherited from parent.
/// </summary>
public Location DefaultLocation { get; }

/// <summary>
/// Gets override object.
/// </summary>
Expand All @@ -63,7 +45,7 @@ public object GetOverrideObject<T>(Func<object> objectConstructor)

internal ArmClientOptions Clone()
{
ArmClientOptions copy = new ArmClientOptions(DefaultLocation);
ArmClientOptions copy = new ArmClientOptions();

copy.ApiVersions = ApiVersions.Clone();
copy.Transport = Transport;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,6 @@ public override void OnReceivedResponse(HttpMessage message)
}
}

[TestCase]
[RecordedTest]
public void ValidateOptionsTestLocation()
{
var x = new ArmClientOptions();
var y = x.Clone();
Assert.IsTrue(ReferenceEquals(x.DefaultLocation, y.DefaultLocation));
}

[TestCase]
[RecordedTest]
public void ValidateOptionsTestApiVersions()
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@ public void MultiClientSeparateVersions()
Assert.AreEqual(FakeResourceApiVersions.V2019_12_01, options2.FakeRestApiVersions().FakeResourceVersion);
}

[TestCase]
public void TestClientOptionsParamCheck()
{
Assert.Throws<ArgumentNullException>(() => { new ArmClientOptions(null); });
}

[TestCase]
public void VersionExist()
{
Expand Down