Skip to content

Commit

Permalink
change location to string to return name instead of display name (#22606
Browse files Browse the repository at this point in the history
)

* update location name and corresponding tests

* update comments
  • Loading branch information
m-nash authored Jul 13, 2021
1 parent d441659 commit 2a9b7c9
Show file tree
Hide file tree
Showing 146 changed files with 332,606 additions and 45,031 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public abstract class ManagementRecordedTestBase<TEnvironment> : RecordedTestBas

private ArmClient _cleanupClient;

protected abstract Type OperationInternalsType { get; }

protected ManagementRecordedTestBase(bool isAsync) : base(isAsync)
{
SessionEnvironment = new TEnvironment();
Expand All @@ -51,8 +53,7 @@ private void Initialize()
{
if (Mode == RecordedTestMode.Playback)
{
var opInternalType = typeof(OperationInternals);
var pollField = opInternalType.GetField("<DefaultPollingInterval>k__BackingField", BindingFlags.Static | BindingFlags.NonPublic);
var pollField = OperationInternalsType.GetField("<DefaultPollingInterval>k__BackingField", BindingFlags.Static | BindingFlags.NonPublic);
pollField.SetValue(null, TimeSpan.Zero);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,12 @@ internal Location(string name, string displayName, string regionalDisplayName)
public static ref readonly Location Default => ref WestUS;

/// <summary>
/// Gets the display name of a location object.
/// Gets the name of a location object.
/// </summary>
/// <returns> Display name. </returns>
/// <returns> The name. </returns>
public override string ToString()
{
return DisplayName;
//return Name; //TODO: change to return Name - TEST FAILURES CAUSED HERE
return Name;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ArmClientTests : ResourceManagerTestBase
private readonly string _location = "southcentralus";

public ArmClientTests(bool isAsync)
: base(isAsync) //, RecordedTestMode.Record)
: base(isAsync)//, RecordedTestMode.Record)
{
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Core.TestFramework;
using Azure.ResourceManager.TestFramework;
using NUnit.Framework;

namespace Azure.ResourceManager.Core.Tests
{
[Parallelizable]
public class ResourceManagerTestBase : ManagementRecordedTestBase<ResourceManagerTestEnvironment>
{
protected ArmClient Client { get; private set; }

protected override Type OperationInternalsType => typeof(OperationInternals);

protected ResourceManagerTestBase(bool isAsync, RecordedTestMode mode)
: base(isAsync, mode)
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2a9b7c9

Please sign in to comment.