File tree Expand file tree Collapse file tree
src/MyTested.AspNetCore.Mvc.TempData/Builders Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,11 +4,9 @@ namespace MyTested.AspNetCore.Mvc.Builders.Contracts.Data
44{
55 public interface IWithoutTempDataBuilder
66 {
7- IAndWithoutTempDataBuilder WithEntry ( string key , object value ) ;
7+ IAndWithoutTempDataBuilder WithoutEntry ( string key ) ;
88
9- IAndWithoutTempDataBuilder WithEntries ( IDictionary < string , object > entries ) ;
10-
11- IAndWithoutTempDataBuilder WithEntries ( object entries ) ;
9+ IAndWithoutTempDataBuilder WithoutEntries ( IEnumerable < string > entriesKeys ) ;
1210
1311 IAndWithoutTempDataBuilder WithoutAllEntries ( ) ;
1412 }
Original file line number Diff line number Diff line change 55 using Microsoft . AspNetCore . Mvc . ViewFeatures ;
66 using Microsoft . AspNetCore . Routing ;
77 using Utilities . Extensions ;
8- using Utilities . Validators ;
98
109 /// <summary>
1110 /// Used for building mocked <see cref="ITempDataDictionary"/>.
Original file line number Diff line number Diff line change 1-
2- namespace MyTested . AspNetCore . Mvc . Builders . Data
1+ namespace MyTested . AspNetCore . Mvc . Builders . Data
32{
4- using System ;
53 using System . Collections . Generic ;
64 using Microsoft . AspNetCore . Mvc . ViewFeatures ;
75 using MyTested . AspNetCore . Mvc . Builders . Contracts . Data ;
@@ -13,29 +11,29 @@ public WithoutTempDataBuilder(ITempDataDictionary tempData)
1311 {
1412 }
1513
16- public IWithoutTempDataBuilder AndAlso ( )
17- {
18- throw new NotImplementedException ( ) ;
19- }
20-
21- public IAndWithoutTempDataBuilder WithEntries ( IDictionary < string , object > entries )
14+ public IAndWithoutTempDataBuilder WithoutEntries ( IEnumerable < string > entriesKeys )
2215 {
23- throw new NotImplementedException ( ) ;
24- }
16+ foreach ( var key in entriesKeys )
17+ {
18+ this . WithoutEntry ( key ) ;
19+ }
2520
26- public IAndWithoutTempDataBuilder WithEntries ( object entries )
27- {
28- throw new NotImplementedException ( ) ;
21+ return this ;
2922 }
3023
31- public IAndWithoutTempDataBuilder WithEntry ( string key , object value )
24+ public IAndWithoutTempDataBuilder WithoutEntry ( string key )
3225 {
33- throw new NotImplementedException ( ) ;
26+ this . TempData . Remove ( key ) ;
27+ return this ;
3428 }
3529
3630 public IAndWithoutTempDataBuilder WithoutAllEntries ( )
3731 {
38- throw new NotImplementedException ( ) ;
32+ this . TempData . Clear ( ) ;
33+ return this ;
3934 }
35+
36+ public IWithoutTempDataBuilder AndAlso ( )
37+ => this ;
4038 }
4139}
You can’t perform that action at this time.
0 commit comments