diff --git a/ADotNet/Models/Foundations/Files/Exceptions/FailedFileSerializationException.cs b/ADotNet/Models/Foundations/Files/Exceptions/FailedFileSerializationException.cs index 6eaf93f..ed31d75 100644 --- a/ADotNet/Models/Foundations/Files/Exceptions/FailedFileSerializationException.cs +++ b/ADotNet/Models/Foundations/Files/Exceptions/FailedFileSerializationException.cs @@ -12,7 +12,12 @@ namespace ADotNet.Models.Foundations.Files.Exceptions public class FailedFileSerializationException : Xeption { public FailedFileSerializationException(Exception innerException) - : base(message: "Failed file serialization error occurred, contact support.", innerException) + : base(message: "Failed file serialization error occurred, contact support.", + innerException: innerException) + { } + + public FailedFileSerializationException(string message, Exception innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/ADotNet/Models/Foundations/Files/Exceptions/FailedFileServiceException.cs b/ADotNet/Models/Foundations/Files/Exceptions/FailedFileServiceException.cs index d59a333..6345b71 100644 --- a/ADotNet/Models/Foundations/Files/Exceptions/FailedFileServiceException.cs +++ b/ADotNet/Models/Foundations/Files/Exceptions/FailedFileServiceException.cs @@ -13,7 +13,11 @@ public class FailedFileServiceException : Xeption { public FailedFileServiceException(Exception innerException) : base(message: "Failed file service error occurred, contact support.", - innerException) + innerException: innerException) + { } + + public FailedFileServiceException(string message, Exception innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/ADotNet/Models/Foundations/Files/Exceptions/FileDependencyException.cs b/ADotNet/Models/Foundations/Files/Exceptions/FileDependencyException.cs index c83219d..9ad3cfd 100644 --- a/ADotNet/Models/Foundations/Files/Exceptions/FileDependencyException.cs +++ b/ADotNet/Models/Foundations/Files/Exceptions/FileDependencyException.cs @@ -12,7 +12,11 @@ public class FileDependencyException : Xeption { public FileDependencyException(Xeption innerException) : base(message: "File dependency error occurred, contact support.", - innerException) + innerException: innerException) + { } + + public FileDependencyException(string message, Xeption innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/ADotNet/Models/Foundations/Files/Exceptions/FileDependencyValidationException.cs b/ADotNet/Models/Foundations/Files/Exceptions/FileDependencyValidationException.cs index 6696688..c7a0e7d 100644 --- a/ADotNet/Models/Foundations/Files/Exceptions/FileDependencyValidationException.cs +++ b/ADotNet/Models/Foundations/Files/Exceptions/FileDependencyValidationException.cs @@ -12,7 +12,11 @@ public class FileDependencyValidationException : Xeption { public FileDependencyValidationException(Xeption innerException) : base(message: "File dependency validation error occurred, fix the errors and try again.", - innerException) + innerException: innerException) + { } + + public FileDependencyValidationException(string message, Xeption innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/ADotNet/Models/Foundations/Files/Exceptions/FileServiceException.cs b/ADotNet/Models/Foundations/Files/Exceptions/FileServiceException.cs index 2dd8f42..35a821f 100644 --- a/ADotNet/Models/Foundations/Files/Exceptions/FileServiceException.cs +++ b/ADotNet/Models/Foundations/Files/Exceptions/FileServiceException.cs @@ -12,7 +12,11 @@ public class FileServiceException : Xeption { public FileServiceException(Xeption innerException) : base(message: "File service error occurred, contact support.", - innerException) + innerException: innerException) + { } + + public FileServiceException(string message, Xeption innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/ADotNet/Models/Foundations/Files/Exceptions/FileValidationException.cs b/ADotNet/Models/Foundations/Files/Exceptions/FileValidationException.cs index 954c644..0ec00b6 100644 --- a/ADotNet/Models/Foundations/Files/Exceptions/FileValidationException.cs +++ b/ADotNet/Models/Foundations/Files/Exceptions/FileValidationException.cs @@ -12,7 +12,11 @@ public class FileValidationException : Xeption { public FileValidationException(Xeption innerException) : base(message: "File validation error occurred, fix the errors and try again.", - innerException) + innerException: innerException) + { } + + public FileValidationException(string message, Xeption innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/ADotNet/Models/Foundations/Files/Exceptions/InvalidFileContentException.cs b/ADotNet/Models/Foundations/Files/Exceptions/InvalidFileContentException.cs index eb62f09..8823963 100644 --- a/ADotNet/Models/Foundations/Files/Exceptions/InvalidFileContentException.cs +++ b/ADotNet/Models/Foundations/Files/Exceptions/InvalidFileContentException.cs @@ -13,5 +13,9 @@ public class InvalidFileContentException : Xeption public InvalidFileContentException() : base(message: "Invalid file content, fix errors and try again.") { } + + public InvalidFileContentException(string message) + : base(message) + { } } -} +} \ No newline at end of file diff --git a/ADotNet/Models/Foundations/Files/Exceptions/InvalidFileDependencyException.cs b/ADotNet/Models/Foundations/Files/Exceptions/InvalidFileDependencyException.cs index 2592a91..7290f8b 100644 --- a/ADotNet/Models/Foundations/Files/Exceptions/InvalidFileDependencyException.cs +++ b/ADotNet/Models/Foundations/Files/Exceptions/InvalidFileDependencyException.cs @@ -13,7 +13,11 @@ public class InvalidFileException : Xeption { public InvalidFileException(Exception innerException) : base(message: "Invalid file error occurred.", - innerException) + innerException: innerException) + { } + + public InvalidFileException(string message, Exception innerException) + : base(message, innerException) { } } -} +} \ No newline at end of file diff --git a/ADotNet/Models/Foundations/Files/Exceptions/InvalidFilePathException.cs b/ADotNet/Models/Foundations/Files/Exceptions/InvalidFilePathException.cs index 8bb464b..8bc2103 100644 --- a/ADotNet/Models/Foundations/Files/Exceptions/InvalidFilePathException.cs +++ b/ADotNet/Models/Foundations/Files/Exceptions/InvalidFilePathException.cs @@ -13,5 +13,9 @@ public class InvalidFilePathException : Xeption public InvalidFilePathException() : base(message: "Invalid file path, fix the errors and try again.") { } + + public InvalidFilePathException(string message) + : base(message) + { } } -} +} \ No newline at end of file diff --git a/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/AdoDependencyException.cs b/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/AdoDependencyException.cs index b98ce72..b6a5837 100644 --- a/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/AdoDependencyException.cs +++ b/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/AdoDependencyException.cs @@ -11,9 +11,12 @@ namespace ADotNet.Models.Pipelines.Exceptions public class AdoDependencyException : Exception { public AdoDependencyException(Exception innerException) - : base("Ado dependency error occured, contact support.", innerException) - { - - } + : base(message: "Ado dependency error occured, contact support.", + innerException: innerException) + { } + + public AdoDependencyException(string message, Exception innerException) + : base(message, innerException) + { } } -} +} \ No newline at end of file diff --git a/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/AdoDependencyValidationException.cs b/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/AdoDependencyValidationException.cs index 885853d..72bc931 100644 --- a/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/AdoDependencyValidationException.cs +++ b/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/AdoDependencyValidationException.cs @@ -11,9 +11,12 @@ namespace ADotNet.Models.Pipelines.Exceptions public class AdoDependencyValidationException : Exception { public AdoDependencyValidationException(Exception innerException) - : base("Ado dependency validation error occured, try again.", innerException) - { - - } + : base(message: "Ado dependency validation error occured, try again.", + innerException: innerException) + { } + + public AdoDependencyValidationException(string message, Exception innerException) + : base(message, innerException) + { } } -} +} \ No newline at end of file diff --git a/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/AdoValidationException.cs b/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/AdoValidationException.cs index 7639d73..4f7c16a 100644 --- a/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/AdoValidationException.cs +++ b/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/AdoValidationException.cs @@ -11,9 +11,12 @@ namespace ADotNet.Models.Pipelines.Exceptions public class AdoValidationException : Exception { public AdoValidationException(Exception innerException) - : base("Ado validation exception occurred, try again", innerException) - { - - } + : base(message: "Ado validation exception occurred, try again", + innerException: innerException) + { } + + public AdoValidationException(string message,Exception innerException) + : base(message, innerException) + { } } -} +} \ No newline at end of file diff --git a/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/BuildServiceException.cs b/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/BuildServiceException.cs index 123c87c..d710c73 100644 --- a/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/BuildServiceException.cs +++ b/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/BuildServiceException.cs @@ -11,9 +11,12 @@ namespace ADotNet.Models.Pipelines.Exceptions public class BuildServiceException : Exception { public BuildServiceException(Exception innerException) - : base("Build service exception occured, contact support.", innerException) - { - - } + : base(message: "Build service exception occured, contact support.", + innerException: innerException) + { } + + public BuildServiceException(string message, Exception innerException) + : base(message, innerException) + { } } -} +} \ No newline at end of file diff --git a/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/NullPathException.cs b/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/NullPathException.cs index 232e546..ce68bbc 100644 --- a/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/NullPathException.cs +++ b/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/NullPathException.cs @@ -11,6 +11,11 @@ namespace ADotNet.Models.Pipelines.Exceptions public class NullPathException : Exception { public NullPathException() - : base("Path is null") { } + : base(message: "Path is null") + { } + + public NullPathException(string message) + : base(message) + { } } -} +} \ No newline at end of file diff --git a/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/NullPipelineException.cs b/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/NullPipelineException.cs index c1c9793..2981d08 100644 --- a/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/NullPipelineException.cs +++ b/ADotNet/Models/Pipelines/AdoPipelines/Exceptions/NullPipelineException.cs @@ -11,6 +11,11 @@ namespace ADotNet.Models.Pipelines.Exceptions public class NullPipelineException : Exception { public NullPipelineException() - : base("Pipeline is null") { } + : base(message: "Pipeline is null") + { } + + public NullPipelineException(string message) + : base(message) + { } } -} +} \ No newline at end of file diff --git a/AdoNet.Tests.Unit/Services/Builds/BuildServiceTests.Exceptions.cs b/AdoNet.Tests.Unit/Services/Builds/BuildServiceTests.Exceptions.cs index 39bd2f2..9b6a8c2 100644 --- a/AdoNet.Tests.Unit/Services/Builds/BuildServiceTests.Exceptions.cs +++ b/AdoNet.Tests.Unit/Services/Builds/BuildServiceTests.Exceptions.cs @@ -17,7 +17,7 @@ public partial class BuildServiceTests { [Theory] [MemberData(nameof(FileValidationExceptions))] - public void ShouldThrowDependencyValidationOnSerializeIfDependencyValidationErrorOccurs( + private void ShouldThrowDependencyValidationOnSerializeIfDependencyValidationErrorOccurs( Exception dependencyValidationException) { // given @@ -56,7 +56,7 @@ public void ShouldThrowDependencyValidationOnSerializeIfDependencyValidationErro [Theory] [MemberData(nameof(FileDependencyExceptions))] - public void ShouldThrowDependencyExceptionOnSerializeIfDependencyValidationErrorOccurs( + private void ShouldThrowDependencyExceptionOnSerializeIfDependencyValidationErrorOccurs( Exception dependencyException) { // given @@ -94,7 +94,7 @@ public void ShouldThrowDependencyExceptionOnSerializeIfDependencyValidationError } [Fact] - public void ShouldThrowServiceExceptionOnSerializeIfSystemErrorOccurs() + private void ShouldThrowServiceExceptionOnSerializeIfSystemErrorOccurs() { // given AspNetPipeline somePipeline = CreateRandomAspNetPipeline(); diff --git a/AdoNet.Tests.Unit/Services/Builds/BuildServiceTests.Validations.cs b/AdoNet.Tests.Unit/Services/Builds/BuildServiceTests.Validations.cs index 56ac137..6ced8a4 100644 --- a/AdoNet.Tests.Unit/Services/Builds/BuildServiceTests.Validations.cs +++ b/AdoNet.Tests.Unit/Services/Builds/BuildServiceTests.Validations.cs @@ -16,14 +16,15 @@ namespace ADotNet.Tests.Unit.Services public partial class BuildServiceTests { [Fact] - public void ShouldThrowValidationExceptionOnSerializeIfPipelineIsNull() + private void ShouldThrowValidationExceptionOnSerializeIfPipelineIsNull() { // given AspNetPipeline invalidPipeline = null; string somePath = GetRandomFilePath(); var nullPiplineException = - new NullPipelineException(); + new NullPipelineException( + message: "Pipeline is null"); // when Action serializeAndWriteToFileAction = () => @@ -50,7 +51,7 @@ public void ShouldThrowValidationExceptionOnSerializeIfPipelineIsNull() } [Fact] - public void ShouldThrowValidationExceptionOnSerializeIfPathIsNull() + private void ShouldThrowValidationExceptionOnSerializeIfPathIsNull() { // given string invalidPath = null; @@ -59,7 +60,8 @@ public void ShouldThrowValidationExceptionOnSerializeIfPathIsNull() CreateRandomAspNetPipeline(); var nullPathException = - new NullPathException(); + new NullPathException( + message: "Path is null"); // when Action serializeAndWriteToFileAction = () => diff --git a/AdoNet.Tests.Unit/Services/Builds/BuildServiceTests.logic.cs b/AdoNet.Tests.Unit/Services/Builds/BuildServiceTests.logic.cs index 7571ea4..e68e49f 100644 --- a/AdoNet.Tests.Unit/Services/Builds/BuildServiceTests.logic.cs +++ b/AdoNet.Tests.Unit/Services/Builds/BuildServiceTests.logic.cs @@ -13,7 +13,7 @@ namespace ADotNet.Tests.Unit.Services public partial class BuildServiceTests { [Fact] - public void ShouldSerializeAndWriteAdoPipelineModel() + private void ShouldSerializeAndWriteAdoPipelineModel() { // given AspNetPipeline randomAspNetPipeline = diff --git a/AdoNet.Tests.Unit/Services/Foundations/Files/FileServiceTests.Exceptions.Write.cs b/AdoNet.Tests.Unit/Services/Foundations/Files/FileServiceTests.Exceptions.Write.cs index c22e58b..d289f87 100644 --- a/AdoNet.Tests.Unit/Services/Foundations/Files/FileServiceTests.Exceptions.Write.cs +++ b/AdoNet.Tests.Unit/Services/Foundations/Files/FileServiceTests.Exceptions.Write.cs @@ -16,7 +16,7 @@ public partial class FileServiceTests { [Theory] [MemberData(nameof(FileDependencyValidationExceptions))] - public void ShouldThrowDependencyValidationExceptionOnWriteIfDependencyValidationErrorOccurs( + private void ShouldThrowDependencyValidationExceptionOnWriteIfDependencyValidationErrorOccurs( Exception dependencyValidationException) { // given @@ -25,11 +25,13 @@ public void ShouldThrowDependencyValidationExceptionOnWriteIfDependencyValidatio var invalidFileException = new InvalidFileException( - dependencyValidationException); + message: "Invalid file error occurred.", + innerException: dependencyValidationException); var fileDependencyValidationException = new FileDependencyValidationException( - invalidFileException); + message: "File dependency validation error occurred, fix the errors and try again.", + innerException: invalidFileException); this.filesBrokerMock.Setup(broker => broker.WriteToFile(It.IsAny(), It.IsAny())) @@ -51,7 +53,7 @@ public void ShouldThrowDependencyValidationExceptionOnWriteIfDependencyValidatio } [Fact] - public void ShouldThrowDependencyExceptionOnWriteIfSerializationErrorOccurs() + private void ShouldThrowDependencyExceptionOnWriteIfSerializationErrorOccurs() { // given string somePath = GetRandomString(); @@ -62,11 +64,13 @@ public void ShouldThrowDependencyExceptionOnWriteIfSerializationErrorOccurs() var failedFileSerializationException = new FailedFileSerializationException( - serializationException); + message: "Failed file serialization error occurred, contact support.", + innerException: serializationException); var fileDependencyException = new FileDependencyException( - failedFileSerializationException); + message: "File dependency error occurred, contact support.", + innerException: failedFileSerializationException); this.filesBrokerMock.Setup(broker => broker.WriteToFile(It.IsAny(), It.IsAny())) @@ -88,7 +92,7 @@ public void ShouldThrowDependencyExceptionOnWriteIfSerializationErrorOccurs() } [Fact] - public void ShoudThrowServiceExceptionOnWriteIfServiceErrorOccurs() + private void ShoudThrowServiceExceptionOnWriteIfServiceErrorOccurs() { // given string somePath = GetRandomString(); @@ -96,10 +100,14 @@ public void ShoudThrowServiceExceptionOnWriteIfServiceErrorOccurs() var serviceException = new Exception(); var failedFileServiceException = - new FailedFileServiceException(serviceException); + new FailedFileServiceException( + message: "Failed file service error occurred, contact support.", + innerException: serviceException); var fileServiceException = - new FileServiceException(failedFileServiceException); + new FileServiceException( + message: "File service error occurred, contact support.", + innerException: failedFileServiceException); this.filesBrokerMock.Setup(broker => broker.WriteToFile(It.IsAny(), It.IsAny())) diff --git a/AdoNet.Tests.Unit/Services/Foundations/Files/FileServiceTests.Logic.Write.cs b/AdoNet.Tests.Unit/Services/Foundations/Files/FileServiceTests.Logic.Write.cs index f1140cb..e8ed34a 100644 --- a/AdoNet.Tests.Unit/Services/Foundations/Files/FileServiceTests.Logic.Write.cs +++ b/AdoNet.Tests.Unit/Services/Foundations/Files/FileServiceTests.Logic.Write.cs @@ -12,7 +12,7 @@ namespace AdoNet.Tests.Unit.Services.Foundations.Files public partial class FileServiceTests { [Fact] - public void ShouldWriteToFile() + private void ShouldWriteToFile() { // given string randomFilePath = GetRandomString(); diff --git a/AdoNet.Tests.Unit/Services/Foundations/Files/FileServiceTests.Validations.Write.cs b/AdoNet.Tests.Unit/Services/Foundations/Files/FileServiceTests.Validations.Write.cs index 69eec28..51e18ae 100644 --- a/AdoNet.Tests.Unit/Services/Foundations/Files/FileServiceTests.Validations.Write.cs +++ b/AdoNet.Tests.Unit/Services/Foundations/Files/FileServiceTests.Validations.Write.cs @@ -17,18 +17,20 @@ public partial class FileServiceTests [InlineData(null)] [InlineData("")] [InlineData(" ")] - public void ShouldThrowValidationExceptionOnWriteIfPathIsInvalid( + private void ShouldThrowValidationExceptionOnWriteIfPathIsInvalid( string invalidPath) { // given string someContent = GetRandomString(); var invalidFilePathException = - new InvalidFilePathException(); + new InvalidFilePathException( + message: "Invalid file path, fix the errors and try again."); var expectedFileValidationException = new FileValidationException( - invalidFilePathException); + message: "File validation error occurred, fix the errors and try again.", + innerException: invalidFilePathException); // when Action writeToFileAction = () => @@ -53,18 +55,20 @@ public void ShouldThrowValidationExceptionOnWriteIfPathIsInvalid( [InlineData(null)] [InlineData("")] [InlineData(" ")] - public void ShouldThrowValidationExceptionOnWriteIfContentIsInvalid( + private void ShouldThrowValidationExceptionOnWriteIfContentIsInvalid( string invalidContent) { // given string somePath = GetRandomString(); var invalidFileContentException = - new InvalidFileContentException(); + new InvalidFileContentException( + message: "Invalid file content, fix errors and try again."); var expectedFileValidationException = new FileValidationException( - invalidFileContentException); + message: "File validation error occurred, fix the errors and try again.", + innerException: invalidFileContentException); // when Action writeToFileAction = () => diff --git a/README.md b/README.md index d73b6bd..e18a797 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,9 @@ ![ADotNet](https://raw.githubusercontent.com/hassanhabib/AdotNet/master/ADotNet/ADotNet_git_logo.png) [![.NET](https://github.com/hassanhabib/ADotNet/actions/workflows/dotnet.yml/badge.svg)](https://github.com/hassanhabib/ADotNet/actions/workflows/dotnet.yml) -![Nuget](https://img.shields.io/nuget/v/ADotNet) -![Nuget](https://img.shields.io/nuget/dt/ADotNet?color=blue&label=Downloads) +![Nuget](https://img.shields.io/nuget/v/ADotNet?logo=nuget&color=blue) +![Nuget](https://img.shields.io/nuget/dt/ADotNet?logo=nuget&color=blue&label=Downloads) +[![The Standard](https://img.shields.io/github/v/release/hassanhabib/The-Standard?filter=v2.10.0&style=default&label=Standard%20Version&color=2ea44f)](https://github.com/hassanhabib/The-Standard) [![The Standard - COMPLIANT](https://img.shields.io/badge/The_Standard-COMPLIANT-2ea44f)](https://github.com/hassanhabib/The-Standard) [![The Standard Community](https://img.shields.io/discord/934130100008538142?color=%237289da&label=The%20Standard%20Community&logo=Discord)](https://discord.gg/vdPZ7hS52X) @@ -14,6 +15,16 @@ ADotNet is a.NET library that enables software engineers on the .NET platform to ## Introduction There's an issue today with developing Azure DevOps pipelines and Git Actions with YAML. The technology/language can be challenging to learn and predict the available options for orchestrating build steps. _ADotNet_ presents a solution to pipeline tasks as C# models, predefined, with all the options available to orchestrate a pipeline without searching for the available options on the documentation websites. +## Standard-Compliance +This library was built according to The Standard. The library follows engineering principles, patterns and tooling as recommended by The Standard. + +This library is also a community effort which involved many nights of pair-programming, test-driven development and in-depth exploration research and design discussions. + +## Standard-Promise +The most important fulfillment aspect in a Standard complaint system is aimed towards contributing to people, its evolution, and principles. +An organization that systematically honors an environment of learning, training, and sharing knowledge is an organization that learns from the past, makes calculated risks for the future, +and brings everyone within it up to speed on the current state of things as honestly, rapidly, and efficiently as possible. + ## How It Works for AzureDevOps Here's how this library works. Let's assume you want to write a task in your pipeline that restores packages for your ASP.NET Core project. Today, engineers write the following command in YAML: @@ -339,3 +350,6 @@ If you have any suggestions, comments or questions, please feel free to contact [LinkedIn](https://www.linkedin.com/in/hassanrezkhabib/) [E-Mail](mailto:hassanhabib@live.com) + +### Important Notice +Special thanks to all the contributors that make this project a success. A special thanks to Mr. Hassan Habib and Mr. Christo du Toit for their dedicated contribution.