diff --git a/tests/Loader/YeSqlLoaderTests.cs b/tests/Loader/YeSqlLoaderTests.cs index 077dc05..e496ea3 100644 --- a/tests/Loader/YeSqlLoaderTests.cs +++ b/tests/Loader/YeSqlLoaderTests.cs @@ -32,16 +32,13 @@ public void LoadFromFiles_WhenErrorsAreFound_ShouldThrowAggregateException() // Act Action action = () => loader.LoadFromFiles(files); - // Asserts - action.Should() - .Throw() - .WithMessage(string.Join(Environment.NewLine, expectedLoaderErrors)); - + // Assert action.Should() - .Throw() + .Throw() + .WithInnerException() + .WithMessage(string.Join(Environment.NewLine, expectedLoaderErrors)) + .WithInnerException() .WithMessage(string.Join(Environment.NewLine, expectedParserErrors)); - - action.Should().Throw(); } [Test] @@ -82,12 +79,11 @@ public void LoadFromFiles_WhenFileHasNotSqlExtension_ShouldThrowAggregateExcepti // Act Action action = () => loader.LoadFromFiles(file); - // Asserts + // Assert action.Should() - .Throw() + .Throw() + .WithInnerException() .WithMessage(expectedMessage); - - action.Should().Throw(); } [Test] @@ -101,12 +97,11 @@ public void LoadFromFiles_WhenSqlFileNotExists_ShouldThrowAggregateException() // Act Action action = () => loader.LoadFromFiles(file); - // Asserts + // Assert action.Should() - .Throw() + .Throw() + .WithInnerException() .WithMessage(expectedMessage); - - action.Should().Throw(); } [TestCase("")] @@ -174,16 +169,13 @@ public void LoadFromDirectories_WhenErrorsAreFound_ShouldThrowAggregateException // Act Action action = () => loader.LoadFromDirectories(directories); - // Asserts - action.Should() - .Throw() - .WithMessage(string.Join(Environment.NewLine, expectedLoaderErrors)); - + // Assert action.Should() - .Throw() + .Throw() + .WithInnerException() + .WithMessage(string.Join(Environment.NewLine, expectedLoaderErrors)) + .WithInnerException() .WithMessage(string.Join(Environment.NewLine, expectedParserErrors)); - - action.Should().Throw(); } [Test] @@ -230,12 +222,11 @@ public void LoadFromDirectories_WhenNotExistsSqlFilesInDirectory_ShouldThrowAggr // Act Action action = () => loader.LoadFromDirectories(directory); - // Asserts + // Assert action.Should() - .Throw() + .Throw() + .WithInnerException() .WithMessage(expectedMessage); - - action.Should().Throw(); } [Test] @@ -265,10 +256,9 @@ public void LoadFromDirectories_WhenDirectoryNotExists_ShouldThrowAggregateExcep // Asserts action.Should() - .Throw() + .Throw() + .WithInnerException() .WithMessage(expectedMessage); - - action.Should().Throw(); } [Test]