Skip to content

Commit

Permalink
Merge pull request #97 from glhays/users/glhays/coderub-standard-v210…
Browse files Browse the repository at this point in the history
…0-upgrade

CODE RUB: Standard Version 2.10.0 Upgrade
  • Loading branch information
hassanhabib authored Jan 6, 2024
2 parents 3ab9e6e + 6a582ae commit fc1c198
Show file tree
Hide file tree
Showing 22 changed files with 153 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public partial class BuildServiceTests
{
[Theory]
[MemberData(nameof(FileValidationExceptions))]
public void ShouldThrowDependencyValidationOnSerializeIfDependencyValidationErrorOccurs(
private void ShouldThrowDependencyValidationOnSerializeIfDependencyValidationErrorOccurs(
Exception dependencyValidationException)
{
// given
Expand Down Expand Up @@ -56,7 +56,7 @@ public void ShouldThrowDependencyValidationOnSerializeIfDependencyValidationErro

[Theory]
[MemberData(nameof(FileDependencyExceptions))]
public void ShouldThrowDependencyExceptionOnSerializeIfDependencyValidationErrorOccurs(
private void ShouldThrowDependencyExceptionOnSerializeIfDependencyValidationErrorOccurs(
Exception dependencyException)
{
// given
Expand Down Expand Up @@ -94,7 +94,7 @@ public void ShouldThrowDependencyExceptionOnSerializeIfDependencyValidationError
}

[Fact]
public void ShouldThrowServiceExceptionOnSerializeIfSystemErrorOccurs()
private void ShouldThrowServiceExceptionOnSerializeIfSystemErrorOccurs()
{
// given
AspNetPipeline somePipeline = CreateRandomAspNetPipeline();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () =>
Expand All @@ -50,7 +51,7 @@ public void ShouldThrowValidationExceptionOnSerializeIfPipelineIsNull()
}

[Fact]
public void ShouldThrowValidationExceptionOnSerializeIfPathIsNull()
private void ShouldThrowValidationExceptionOnSerializeIfPathIsNull()
{
// given
string invalidPath = null;
Expand All @@ -59,7 +60,8 @@ public void ShouldThrowValidationExceptionOnSerializeIfPathIsNull()
CreateRandomAspNetPipeline();

var nullPathException =
new NullPathException();
new NullPathException(
message: "Path is null");

// when
Action serializeAndWriteToFileAction = () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ADotNet.Tests.Unit.Services
public partial class BuildServiceTests
{
[Fact]
public void ShouldSerializeAndWriteAdoPipelineModel()
private void ShouldSerializeAndWriteAdoPipelineModel()
{
// given
AspNetPipeline randomAspNetPipeline =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public partial class FileServiceTests
{
[Theory]
[MemberData(nameof(FileDependencyValidationExceptions))]
public void ShouldThrowDependencyValidationExceptionOnWriteIfDependencyValidationErrorOccurs(
private void ShouldThrowDependencyValidationExceptionOnWriteIfDependencyValidationErrorOccurs(
Exception dependencyValidationException)
{
// given
Expand All @@ -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<string>(), It.IsAny<string>()))
Expand All @@ -51,7 +53,7 @@ public void ShouldThrowDependencyValidationExceptionOnWriteIfDependencyValidatio
}

[Fact]
public void ShouldThrowDependencyExceptionOnWriteIfSerializationErrorOccurs()
private void ShouldThrowDependencyExceptionOnWriteIfSerializationErrorOccurs()
{
// given
string somePath = GetRandomString();
Expand All @@ -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<string>(), It.IsAny<string>()))
Expand All @@ -88,18 +92,22 @@ public void ShouldThrowDependencyExceptionOnWriteIfSerializationErrorOccurs()
}

[Fact]
public void ShoudThrowServiceExceptionOnWriteIfServiceErrorOccurs()
private void ShoudThrowServiceExceptionOnWriteIfServiceErrorOccurs()
{
// given
string somePath = GetRandomString();
string someContent = GetRandomString();
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<string>(), It.IsAny<string>()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading

0 comments on commit fc1c198

Please sign in to comment.