Skip to content

Commit 50d0ac6

Browse files
committed
Added documentation summary for IAggregateExceptionTestBuilder (#73)
1 parent 74db655 commit 50d0ac6

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

src/MyWebApi/Builders/Contracts/ExceptionErrors/IAggregateExceptionTestBuilder.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,16 @@
1616

1717
namespace MyWebApi.Builders.Contracts.ExceptionErrors
1818
{
19+
/// <summary>
20+
/// Used for testing AggregateException.
21+
/// </summary>
1922
public interface IAggregateExceptionTestBuilder : IBaseExceptionTestBuilder
2023
{
24+
/// <summary>
25+
/// Tests whether AggregateException contains inner exception of the provided type.
26+
/// </summary>
27+
/// <typeparam name="TInnerException">Expected inner exception type.</typeparam>
28+
/// <returns>The same aggregate exception test builder.</returns>
2129
IAndAggregateExceptionTestBuilder ContainingInnerExceptionOfType<TInnerException>();
2230
}
2331
}

src/MyWebApi/Builders/Contracts/ExceptionErrors/IAndAggregateExceptionTestBuilder.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@
1616

1717
namespace MyWebApi.Builders.Contracts.ExceptionErrors
1818
{
19+
/// <summary>
20+
/// Used for adding AndAlso() method to the aggregate exception tests.
21+
/// </summary>
1922
public interface IAndAggregateExceptionTestBuilder : IAggregateExceptionTestBuilder
2023
{
24+
/// <summary>
25+
/// AndAlso method for better readability when chaining aggregate exception tests.
26+
/// </summary>
27+
/// <returns>The same aggregate exception test builder.</returns>
2128
IAggregateExceptionTestBuilder AndAlso();
2229
}
2330
}

src/MyWebApi/Builders/Contracts/ExceptionErrors/IBaseExceptionTestBuilder.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ namespace MyWebApi.Builders.Contracts.ExceptionErrors
1818
{
1919
using Base;
2020

21+
/// <summary>
22+
/// Used for testing expected exception messages.
23+
/// </summary>
2124
public interface IBaseExceptionTestBuilder : IBaseTestBuilder
2225
{
2326
/// <summary>

src/MyWebApi/Builders/ExceptionErrors/AggregateExceptionTestBuilder.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,19 @@ namespace MyWebApi.Builders.ExceptionErrors
2424
using Exceptions;
2525
using Utilities;
2626

27+
/// <summary>
28+
/// Used for testing AggregateException.
29+
/// </summary>
2730
public class AggregateExceptionTestBuilder : ExceptionTestBuilder, IAndAggregateExceptionTestBuilder
2831
{
2932
private readonly AggregateException aggregateException;
3033

34+
/// <summary>
35+
/// Initializes a new instance of the <see cref="AggregateExceptionTestBuilder" /> class.
36+
/// </summary>
37+
/// <param name="controller">Controller on which the action will be tested.</param>
38+
/// <param name="actionName">Name of the tested action.</param>
39+
/// <param name="caughtException">Actual received aggregate exception.</param>
3140
public AggregateExceptionTestBuilder(
3241
ApiController controller,
3342
string actionName,
@@ -37,6 +46,11 @@ public AggregateExceptionTestBuilder(
3746
this.aggregateException = caughtException;
3847
}
3948

49+
/// <summary>
50+
/// Tests whether AggregateException contains inner exception of the provided type.
51+
/// </summary>
52+
/// <typeparam name="TInnerException">Expected inner exception type.</typeparam>
53+
/// <returns>The same aggregate exception test builder.</returns>
4054
public IAndAggregateExceptionTestBuilder ContainingInnerExceptionOfType<TInnerException>()
4155
{
4256
var expectedInnerExceptionType = typeof(TInnerException);
@@ -53,6 +67,10 @@ public IAndAggregateExceptionTestBuilder ContainingInnerExceptionOfType<TInnerEx
5367
return this;
5468
}
5569

70+
/// <summary>
71+
/// AndAlso method for better readability when chaining aggregate exception tests.
72+
/// </summary>
73+
/// <returns>The same aggregate exception test builder.</returns>
5674
public new IAggregateExceptionTestBuilder AndAlso()
5775
{
5876
return this;

0 commit comments

Comments
 (0)