This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor TagTemplateCreator and tests. * Resource name generator helper added * Introduce error messages and exception for duplicate sanitized tag's display name * Update documentation for tags creation * Combine common utilities into NamingHelper * Change path generation for templates in the CreatorExecutor. Add CreatorExecutorTests Co-authored-by: Farhad Alizada <falizada@microsoft.com>
- Loading branch information
Showing
25 changed files
with
460 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// -------------------------------------------------------------------------- | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// -------------------------------------------------------------------------- | ||
|
||
namespace Microsoft.Azure.Management.ApiManagement.ArmTemplates.Common.Constants | ||
{ | ||
public static class ErrorMessages | ||
{ | ||
public const string DuplicateTagResourceNameErrorMessage = "Duplicate tag resource name found during sanitizing the display name. Please consider renaming tags: {0}, {1}. Both resulted resource name to be equal to: {2}"; | ||
public const string EmptyResourceNameAfterSanitizingErrorMessage = "Sanitizing the display name '{0}' resulted empty string"; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/ArmTemplates/Common/Exceptions/DuplicateTagResourceNameException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// -------------------------------------------------------------------------- | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// -------------------------------------------------------------------------- | ||
|
||
using System; | ||
using Microsoft.Azure.Management.ApiManagement.ArmTemplates.Common.Constants; | ||
|
||
namespace Microsoft.Azure.Management.ApiManagement.ArmTemplates.Common.Exceptions | ||
{ | ||
public class DuplicateTagResourceNameException : Exception | ||
{ | ||
public DuplicateTagResourceNameException(string existingValue, string tagName, string resourceName): base (string.Format(ErrorMessages.DuplicateTagResourceNameErrorMessage, existingValue, tagName, resourceName)) | ||
{ | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/ArmTemplates/Common/Exceptions/EmptyResourceNameException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// -------------------------------------------------------------------------- | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// -------------------------------------------------------------------------- | ||
|
||
using System; | ||
using Microsoft.Azure.Management.ApiManagement.ArmTemplates.Common.Constants; | ||
|
||
namespace Microsoft.Azure.Management.ApiManagement.ArmTemplates.Common.Exceptions | ||
{ | ||
public class EmptyResourceNameException : Exception | ||
{ | ||
public EmptyResourceNameException(string resourceName) : base(string.Format(ErrorMessages.EmptyResourceNameAfterSanitizingErrorMessage, resourceName)) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.