Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TestHelperProjects>Resources201705;</TestHelperProjects>
<NoWarn>$(NoWarn);SA1649</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(AzureCoreTestFramework)" />
Expand Down
18 changes: 8 additions & 10 deletions sdk/dns/Azure.ResourceManager.Dns/tests/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,20 @@ public static bool AreEqualPrereq(
Azure.ResourceManager.Dns.Models.Resource second,
bool ignoreEtag = false)
{
if (first == null && second == null)
{
return true;
}
else if (first == null || second == null)

if (first == null || second == null)
{
return false;
}

if (first.Location != second.Location
|| first.Name != second.Name)
if (first.Location.ToLower() != second.Location.ToLower())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: String.Compare() is preferred over ==/!=

{
return false;
}

if (first.Tags != null || second.Tags != null)
if (first.Tags != null && second.Tags != null)
{
if (first.Tags == null || second.Tags == null ||
first.Tags.Count != second.Tags.Count)
if (first.Tags.Count != second.Tags.Count)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if you ever need to compare content of Tags collection, LINQ's Intersect, Except are useful.

{
return false;
}
Expand All @@ -54,6 +49,9 @@ public static bool AreEqualPrereq(
}
}
}
else{
return false;
}

return true;
}
Expand Down

This file was deleted.

This file was deleted.

Loading