Skip to content

Commit 2a70081

Browse files
committed
#283 Adding xml documentation for all public methods and classes.
1 parent 1c6acdc commit 2a70081

5 files changed

Lines changed: 82 additions & 3 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
namespace MyTested.AspNetCore.Mvc.Builders.Contracts.Data
22
{
3+
/// <summary>
4+
/// Used for adding AndAlso() method to the <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary"/> builder.
5+
/// </summary>
36
public interface IAndWithoutTempDataBuilder : IWithoutTempDataBuilder
47
{
8+
/// <summary>
9+
/// AndAlso method for better readability when building <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary"/>.
10+
/// </summary>
11+
/// <returns>The same <see cref="IWithoutTempDataBuilder"/>.</returns>
512
IWithoutTempDataBuilder AndAlso();
613
}
714
}
Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
1-
using System.Collections.Generic;
2-
3-
namespace MyTested.AspNetCore.Mvc.Builders.Contracts.Data
1+
namespace MyTested.AspNetCore.Mvc.Builders.Contracts.Data
42
{
3+
using System.Collections.Generic;
4+
5+
/// <summary>
6+
/// Used for building <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary"/>.
7+
/// </summary>
58
public interface IWithoutTempDataBuilder
69
{
10+
/// <summary>
11+
/// Remove temp data entry by providing its key to the built <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary"/>.
12+
/// </summary>
13+
/// <param name="key">Key of the temp data entry.</param>
14+
/// <returns>The same <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary"/>.</returns>
715
IAndWithoutTempDataBuilder WithoutEntry(string key);
816

17+
/// <summary>
18+
/// Remove temp data entries by providing their keys to the built <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary"/>.
19+
/// </summary>
20+
/// <param name="entriesKeys">Keys of the temp data entries to be deleted.</param>
21+
/// <returns>The same <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary"/>.</returns>
922
IAndWithoutTempDataBuilder WithoutEntries(IEnumerable<string> entriesKeys);
1023

24+
/// <summary>
25+
/// Clear all entities from the built <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary"/>.
26+
/// </summary>
27+
/// <returns>The same <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary"/>.</returns>
1128
IAndWithoutTempDataBuilder WithoutAllEntries();
1229
}
1330
}

src/MyTested.AspNetCore.Mvc.TempData/Builders/Data/BaseTempDataBuilder.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33
using Microsoft.AspNetCore.Mvc.ViewFeatures;
44
using MyTested.AspNetCore.Mvc.Utilities.Validators;
55

6+
/// <summary>
7+
/// Used for building mocked <see cref="ITempDataDictionary"/>.
8+
/// </summary>
69
public abstract class BaseTempDataBuilder
710
{
11+
/// <summary>
12+
/// Abstract <see cref="BaseTempDataBuilder"/> class.
13+
/// </summary>
14+
/// <param name="tempData"><see cref="ITempDataDictionary"/> to built.</param>
815
public BaseTempDataBuilder(ITempDataDictionary tempData)
916
{
1017
CommonValidator.CheckForNullReference(tempData, nameof(ITempDataDictionary));

src/MyTested.AspNetCore.Mvc.TempData/Builders/Data/WithoutTempDataBuilder.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@
44
using Microsoft.AspNetCore.Mvc.ViewFeatures;
55
using MyTested.AspNetCore.Mvc.Builders.Contracts.Data;
66

7+
/// <summary>
8+
/// Used for building mocked <see cref="ITempDataDictionary"/>.
9+
/// </summary>
710
public class WithoutTempDataBuilder : BaseTempDataBuilder, IAndWithoutTempDataBuilder
811
{
12+
/// <summary>
13+
/// Initializes a new instance of the <see cref="WithoutTempDataBuilder"/> class.
14+
/// </summary>
15+
/// <param name="tempData"><see cref="ITempDataDictionary"/> to built.</param>
916
public WithoutTempDataBuilder(ITempDataDictionary tempData)
1017
: base(tempData)
1118
{
1219
}
1320

21+
/// <inheritdoc />
1422
public IAndWithoutTempDataBuilder WithoutEntries(IEnumerable<string> entriesKeys)
1523
{
1624
foreach (var key in entriesKeys)
@@ -21,18 +29,21 @@ public IAndWithoutTempDataBuilder WithoutEntries(IEnumerable<string> entriesKeys
2129
return this;
2230
}
2331

32+
/// <inheritdoc />
2433
public IAndWithoutTempDataBuilder WithoutEntry(string key)
2534
{
2635
this.TempData.Remove(key);
2736
return this;
2837
}
2938

39+
/// <inheritdoc />
3040
public IAndWithoutTempDataBuilder WithoutAllEntries()
3141
{
3242
this.TempData.Clear();
3343
return this;
3444
}
3545

46+
/// <inheritdoc />
3647
public IWithoutTempDataBuilder AndAlso()
3748
=> this;
3849
}

src/MyTested.AspNetCore.Mvc.TempData/ComponentBuilderTempDataWithoutExtensions.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,68 @@
88
using Builders.Data;
99
using Internal.TestContexts;
1010

11+
/// <summary>
12+
/// Contains <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionary"/> extension methods for <see cref="IBaseTestBuilderWithComponentBuilder{TBuilder}"/>.
13+
/// </summary>
1114
public static class ComponentBuilderTempDataWithoutExtensions
1215
{
16+
/// <summary>
17+
/// Remove entity by providing its key from <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionary"/>.
18+
/// </summary>
19+
/// <typeparam name="TBuilder">Class representing ASP.NET Core MVC test builder.</typeparam>
20+
/// <param name="builder">Instance of <see cref="IBaseTestBuilderWithComponentBuilder{TBuilder}"/> type.</param>
21+
/// <param name="key">The key of the entity to be deleted.</param>
22+
/// <returns>The same component builder.</returns>
1323
public static TBuilder WithoutTempData<TBuilder>(
1424
this IBaseTestBuilderWithComponentBuilder<TBuilder> builder,
1525
string key)
1626
where TBuilder : IBaseTestBuilder
1727
=> builder.WithoutTempData(tempData => tempData.WithoutEntry(key));
1828

29+
/// <summary>
30+
/// Remove entities by providing their keys from <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionary"/>.
31+
/// </summary>
32+
/// <typeparam name="TBuilder">Class representing ASP.NET Core MVC test builder.</typeparam>
33+
/// <param name="builder">Instance of <see cref="IBaseTestBuilderWithComponentBuilder{TBuilder}"/> type.</param>
34+
/// <param name="keys">The keys of the entities to be deleted.</param>
35+
/// <returns>The same component builder.</returns>
1936
public static TBuilder WithoutTempData<TBuilder>(
2037
this IBaseTestBuilderWithComponentBuilder<TBuilder> builder,
2138
params string[] keys)
2239
where TBuilder : IBaseTestBuilder
2340
=> builder.WithoutTempData(tempData => tempData.WithoutEntries(keys));
2441

42+
/// <summary>
43+
/// Remove entities by providing their keys from <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionary"/>.
44+
/// </summary>
45+
/// <typeparam name="TBuilder">Class representing ASP.NET Core MVC test builder.</typeparam>
46+
/// <param name="builder">Instance of <see cref="IBaseTestBuilderWithComponentBuilder{TBuilder}"/> type.</param>
47+
/// <param name="keys">The keys of the entities to be deleted.</param>
48+
/// <returns>The same component builder.</returns>
2549
public static TBuilder WithoutTempData<TBuilder>(
2650
this IBaseTestBuilderWithComponentBuilder<TBuilder> builder,
2751
IEnumerable<string> keys)
2852
where TBuilder : IBaseTestBuilder
2953
=> builder.WithoutTempData(tempData => tempData.WithoutEntries(keys));
3054

55+
/// <summary>
56+
/// Removing all entities from <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionary"/>.
57+
/// </summary>
58+
/// <typeparam name="TBuilder">Class representing ASP.NET Core MVC test builder.</typeparam>
59+
/// <param name="builder">Instance of <see cref="IBaseTestBuilderWithComponentBuilder{TBuilder}"/> type.</param>
60+
/// <returns>The same component builder.</returns>
3161
public static TBuilder WithoutTempData<TBuilder>(
3262
this IBaseTestBuilderWithComponentBuilder<TBuilder> builder)
3363
where TBuilder : IBaseTestBuilder
3464
=> builder.WithoutTempData(tempData => tempData.WithoutAllEntries());
3565

66+
/// <summary>
67+
/// Remove values from <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionary"/> on the tested component.
68+
/// </summary>
69+
/// <typeparam name="TBuilder">Class representing ASP.NET Core MVC test builder.</typeparam>
70+
/// <param name="builder">Instance of <see cref="IBaseTestBuilderWithComponentBuilder{TBuilder}"/> type.</param>
71+
/// <param name="tempDataBuilder">Action setting the <see cref="Microsoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionary"/> values by using <see cref="IWithTempDataBuilder"/>.</param>
72+
/// <returns>The same component builder.</returns>
3673
public static TBuilder WithoutTempData<TBuilder>(
3774
this IBaseTestBuilderWithComponentBuilder<TBuilder> builder,
3875
Action<IWithoutTempDataBuilder> tempDataBuilder)

0 commit comments

Comments
 (0)