|
10 | 10 | /// <summary> |
11 | 11 | /// Used for building mocked <see cref="ITempDataDictionary"/>. |
12 | 12 | /// </summary> |
13 | | - public class TempDataBuilder : IAndTempDataBuilder |
| 13 | + public class WithTempDataBuilder : BaseTempDataBuilder, IAndWithTempDataBuilder |
14 | 14 | { |
15 | 15 | /// <summary> |
16 | | - /// Initializes a new instance of the <see cref="TempDataBuilder"/> class. |
| 16 | + /// Initializes a new instance of the <see cref="WithTempDataBuilder"/> class. |
17 | 17 | /// </summary> |
18 | 18 | /// <param name="tempData"><see cref="ITempDataDictionary"/> to built.</param> |
19 | | - public TempDataBuilder(ITempDataDictionary tempData) |
| 19 | + public WithTempDataBuilder(ITempDataDictionary tempData) |
| 20 | + : base(tempData) |
20 | 21 | { |
21 | | - CommonValidator.CheckForNullReference(tempData, nameof(ITempDataDictionary)); |
22 | | - this.TempData = tempData; |
23 | 22 | } |
24 | 23 |
|
25 | | - /// <summary> |
26 | | - /// Gets the mocked <see cref="ITempDataDictionary"/>. |
27 | | - /// </summary> |
28 | | - /// <value>Built <see cref="ITempDataDictionary"/>.</value> |
29 | | - protected ITempDataDictionary TempData { get; private set; } |
30 | | - |
31 | 24 | /// <inheritdoc /> |
32 | | - public IAndTempDataBuilder WithEntry(string key, object value) |
| 25 | + public IAndWithTempDataBuilder WithEntry(string key, object value) |
33 | 26 | { |
34 | 27 | this.TempData.Add(key, value); |
35 | 28 | return this; |
36 | 29 | } |
37 | 30 |
|
38 | 31 | /// <inheritdoc /> |
39 | | - public IAndTempDataBuilder WithEntries(IDictionary<string, object> entries) |
| 32 | + public IAndWithTempDataBuilder WithEntries(IDictionary<string, object> entries) |
40 | 33 | { |
41 | 34 | entries.ForEach(e => this.WithEntry(e.Key, e.Value)); |
42 | 35 | return this; |
43 | 36 | } |
44 | 37 |
|
45 | 38 | /// <inheritdoc /> |
46 | | - public IAndTempDataBuilder WithEntries(object entries) |
| 39 | + public IAndWithTempDataBuilder WithEntries(object entries) |
47 | 40 | => this.WithEntries(new RouteValueDictionary(entries)); |
48 | 41 |
|
49 | 42 | /// <inheritdoc /> |
50 | | - public ITempDataBuilder AndAlso() => this; |
| 43 | + public IWithTempDataBuilder AndAlso() => this; |
51 | 44 | } |
52 | 45 | } |
0 commit comments