Skip to content

Commit 068978c

Browse files
committed
Indentation fixes to TemData unit tests.
1 parent 94d9482 commit 068978c

File tree

4 files changed

+116
-146
lines changed

4 files changed

+116
-146
lines changed

test/MyTested.AspNetCore.Mvc.TempData.Test/BuildersTests/ActionsTests/ShouldHaveTests/ShouldHaveTempDataTests.cs

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -347,34 +347,34 @@ public void TempDataWithBuilderShouldThrowWithDictionaryOfTempDataEntriesWithInv
347347
public void TempDataWithBuilderWithPredicateShouldWorkWithCorrectPassingAssertions()
348348
{
349349
MyController<MvcController>
350-
.Instance()
351-
.Calling(c => c.AddTempDataAction())
352-
.ShouldHave()
353-
.TempData(tempData => tempData
354-
.ContainingEntry(entry => entry
355-
.WithKey("Test")
356-
.WithValueOfType<string>()
357-
.Passing(v => Assert.StartsWith("Temp", v))))
358-
.AndAlso()
359-
.ShouldReturn()
360-
.Ok();
350+
.Instance()
351+
.Calling(c => c.AddTempDataAction())
352+
.ShouldHave()
353+
.TempData(tempData => tempData
354+
.ContainingEntry(entry => entry
355+
.WithKey("Test")
356+
.WithValueOfType<string>()
357+
.Passing(v => Assert.StartsWith("Temp", v))))
358+
.AndAlso()
359+
.ShouldReturn()
360+
.Ok();
361361
}
362362

363363
[Fact]
364364
public void TempDataWithBuilderWithPredicateShouldWorkWithCorrectPassingPredicate()
365365
{
366366
MyController<MvcController>
367-
.Instance()
368-
.Calling(c => c.AddTempDataAction())
369-
.ShouldHave()
370-
.TempData(tempData => tempData
371-
.ContainingEntry(entry => entry
372-
.WithKey("Test")
373-
.WithValueOfType<string>()
374-
.Passing(v => v.StartsWith("Temp"))))
375-
.AndAlso()
376-
.ShouldReturn()
377-
.Ok();
367+
.Instance()
368+
.Calling(c => c.AddTempDataAction())
369+
.ShouldHave()
370+
.TempData(tempData => tempData
371+
.ContainingEntry(entry => entry
372+
.WithKey("Test")
373+
.WithValueOfType<string>()
374+
.Passing(v => v.StartsWith("Temp"))))
375+
.AndAlso()
376+
.ShouldReturn()
377+
.Ok();
378378
}
379379

380380
[Fact]
@@ -403,13 +403,13 @@ public void TempDataWithBuilderWithPredicateShouldThrowWithIncorrectPassingPredi
403403
public void ContainingEntryOfTypeShouldNotThrowWithCorrectEntry()
404404
{
405405
MyController<MvcController>
406-
.Instance()
407-
.Calling(c => c.AddTempDataAction())
408-
.ShouldHave()
409-
.TempData(tempData => tempData.ContainingEntryOfType<string>())
410-
.AndAlso()
411-
.ShouldReturn()
412-
.Ok();
406+
.Instance()
407+
.Calling(c => c.AddTempDataAction())
408+
.ShouldHave()
409+
.TempData(tempData => tempData.ContainingEntryOfType<string>())
410+
.AndAlso()
411+
.ShouldReturn()
412+
.Ok();
413413
}
414414

415415
[Fact]
@@ -434,13 +434,13 @@ public void ContainingEntryOfTypeShouldThrowWithIncorrectEntry()
434434
public void ContainingEntryOfTypeAndKeyShouldNotThrowWithCorrectEntry()
435435
{
436436
MyController<MvcController>
437-
.Instance()
438-
.Calling(c => c.AddTempDataAction())
439-
.ShouldHave()
440-
.TempData(tempData => tempData.ContainingEntryOfType<string>("Test"))
441-
.AndAlso()
442-
.ShouldReturn()
443-
.Ok();
437+
.Instance()
438+
.Calling(c => c.AddTempDataAction())
439+
.ShouldHave()
440+
.TempData(tempData => tempData.ContainingEntryOfType<string>("Test"))
441+
.AndAlso()
442+
.ShouldReturn()
443+
.Ok();
444444
}
445445

446446
[Fact]
@@ -483,13 +483,13 @@ public void ContainingEntryOfTypeAndKeyShouldThrowWithIncorrectEntry()
483483
public void ContainingEntryWithValueShouldNotThrowWithCorrectEntry()
484484
{
485485
MyController<MvcController>
486-
.Instance()
487-
.Calling(c => c.AddTempDataAction())
488-
.ShouldHave()
489-
.TempData(tempData => tempData.ContainingEntryWithValue("TempValue"))
490-
.AndAlso()
491-
.ShouldReturn()
492-
.Ok();
486+
.Instance()
487+
.Calling(c => c.AddTempDataAction())
488+
.ShouldHave()
489+
.TempData(tempData => tempData.ContainingEntryWithValue("TempValue"))
490+
.AndAlso()
491+
.ShouldReturn()
492+
.Ok();
493493
}
494494

495495
[Fact]
@@ -514,16 +514,16 @@ public void ContainingEntryWithValueShouldThrowWithIncorrectEntry()
514514
public void ContainingEntryWithKeyShouldNotThrowWithCorrectEntry()
515515
{
516516
MyController<MvcController>
517-
.Instance()
518-
.Calling(c => c.AddTempDataAction())
519-
.ShouldHave()
520-
.TempData(tempData => tempData
521-
.ContainingEntryWithKey("Test")
522-
.AndAlso()
523-
.ContainingEntryWithKey("Another"))
524-
.AndAlso()
525-
.ShouldReturn()
526-
.Ok();
517+
.Instance()
518+
.Calling(c => c.AddTempDataAction())
519+
.ShouldHave()
520+
.TempData(tempData => tempData
521+
.ContainingEntryWithKey("Test")
522+
.AndAlso()
523+
.ContainingEntryWithKey("Another"))
524+
.AndAlso()
525+
.ShouldReturn()
526+
.Ok();
527527
}
528528

529529
[Fact]

test/MyTested.AspNetCore.Mvc.TempData.Test/BuildersTests/ControllersTests/ControllerBuilderTests.cs

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ public void WithValidTempDataValueShouldPopulateTempDataCorrectly()
1313
{
1414
MyController<MvcController>
1515
.Instance()
16-
.WithTempData(tempData =>
17-
{
18-
tempData.WithEntry("test", "value");
19-
})
16+
.WithTempData(tempData => tempData.WithEntry("test", "value"))
2017
.Calling(c => c.TempDataAction())
2118
.ShouldReturn()
2219
.Ok();
@@ -27,10 +24,7 @@ public void WithInvalidTempDataValueShouldReturnBadRequest()
2724
{
2825
MyController<MvcController>
2926
.Instance()
30-
.WithTempData(tempData =>
31-
{
32-
tempData.WithEntry("invalid", "value");
33-
})
27+
.WithTempData(tempData => tempData.WithEntry("invalid", "value"))
3428
.Calling(c => c.TempDataAction())
3529
.ShouldReturn()
3630
.BadRequest();
@@ -54,17 +48,11 @@ public void WithValidTempDataValueShouldPopulateTempDataCorrectlyForPocoControll
5448
{
5549
MyApplication
5650
.StartsFrom<DefaultStartup>()
57-
.WithServices(services =>
58-
{
59-
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
60-
});
51+
.WithServices(services => services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>());
6152

6253
MyController<FullPocoController>
6354
.Instance()
64-
.WithTempData(tempData =>
65-
{
66-
tempData.WithEntry("test", "value");
67-
})
55+
.WithTempData(tempData => tempData.WithEntry("test", "value"))
6856
.Calling(c => c.TempDataAction())
6957
.ShouldReturn()
7058
.Ok();
@@ -77,17 +65,11 @@ public void WithInvalidTempDataValueShouldReturnBadRequestForPocoController()
7765
{
7866
MyApplication
7967
.StartsFrom<DefaultStartup>()
80-
.WithServices(services =>
81-
{
82-
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
83-
});
68+
.WithServices(services => services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>());
8469

8570
MyController<FullPocoController>
8671
.Instance()
87-
.WithTempData(tempData =>
88-
{
89-
tempData.WithEntry("invalid", "value");
90-
})
72+
.WithTempData(tempData => tempData.WithEntry("invalid", "value"))
9173
.Calling(c => c.TempDataAction())
9274
.ShouldReturn()
9375
.BadRequest();
@@ -100,10 +82,7 @@ public void WithTempDataShouldPopulateTempDataForPocoController()
10082
{
10183
MyApplication
10284
.StartsFrom<DefaultStartup>()
103-
.WithServices(services =>
104-
{
105-
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
106-
});
85+
.WithServices(services => services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>());
10786

10887
MyController<FullPocoController>
10988
.Instance()

test/MyTested.AspNetCore.Mvc.TempData.Test/BuildersTests/InvocationsTests/ShouldHaveTests/ShouldHaveTempDataTests.cs

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -347,34 +347,34 @@ public void TempDataWithBuilderShouldThrowWithDictionaryOfTempDataEntriesWithInv
347347
public void TempDataWithBuilderWithPredicateShouldWorkWithCorrectPassingAssertions()
348348
{
349349
MyViewComponent<AddTempDataComponent>
350-
.Instance()
351-
.InvokedWith(c => c.Invoke())
352-
.ShouldHave()
353-
.TempData(tempData => tempData
354-
.ContainingEntry(entry => entry
355-
.WithKey("Test")
356-
.WithValueOfType<string>()
357-
.Passing(v => Assert.StartsWith("Temp", v))))
358-
.AndAlso()
359-
.ShouldReturn()
360-
.View();
350+
.Instance()
351+
.InvokedWith(c => c.Invoke())
352+
.ShouldHave()
353+
.TempData(tempData => tempData
354+
.ContainingEntry(entry => entry
355+
.WithKey("Test")
356+
.WithValueOfType<string>()
357+
.Passing(v => Assert.StartsWith("Temp", v))))
358+
.AndAlso()
359+
.ShouldReturn()
360+
.View();
361361
}
362362

363363
[Fact]
364364
public void TempDataWithBuilderWithPredicateShouldWorkWithCorrectPassingPredicate()
365365
{
366366
MyViewComponent<AddTempDataComponent>
367-
.Instance()
368-
.InvokedWith(c => c.Invoke())
369-
.ShouldHave()
370-
.TempData(tempData => tempData
371-
.ContainingEntry(entry => entry
372-
.WithKey("Test")
373-
.WithValueOfType<string>()
374-
.Passing(v => v.StartsWith("Temp"))))
375-
.AndAlso()
376-
.ShouldReturn()
377-
.View();
367+
.Instance()
368+
.InvokedWith(c => c.Invoke())
369+
.ShouldHave()
370+
.TempData(tempData => tempData
371+
.ContainingEntry(entry => entry
372+
.WithKey("Test")
373+
.WithValueOfType<string>()
374+
.Passing(v => v.StartsWith("Temp"))))
375+
.AndAlso()
376+
.ShouldReturn()
377+
.View();
378378
}
379379

380380
[Fact]
@@ -403,13 +403,13 @@ public void TempDataWithBuilderWithPredicateShouldThrowWithIncorrectPassingPredi
403403
public void ContainingEntryOfTypeShouldNotThrowWithCorrectEntry()
404404
{
405405
MyViewComponent<AddTempDataComponent>
406-
.Instance()
407-
.InvokedWith(c => c.Invoke())
408-
.ShouldHave()
409-
.TempData(tempData => tempData.ContainingEntryOfType<string>())
410-
.AndAlso()
411-
.ShouldReturn()
412-
.View();
406+
.Instance()
407+
.InvokedWith(c => c.Invoke())
408+
.ShouldHave()
409+
.TempData(tempData => tempData.ContainingEntryOfType<string>())
410+
.AndAlso()
411+
.ShouldReturn()
412+
.View();
413413
}
414414

415415
[Fact]
@@ -434,13 +434,13 @@ public void ContainingEntryOfTypeShouldThrowWithIncorrectEntry()
434434
public void ContainingEntryOfTypeAndKeyShouldNotThrowWithCorrectEntry()
435435
{
436436
MyViewComponent<AddTempDataComponent>
437-
.Instance()
438-
.InvokedWith(c => c.Invoke())
439-
.ShouldHave()
440-
.TempData(tempData => tempData.ContainingEntryOfType<string>("Test"))
441-
.AndAlso()
442-
.ShouldReturn()
443-
.View();
437+
.Instance()
438+
.InvokedWith(c => c.Invoke())
439+
.ShouldHave()
440+
.TempData(tempData => tempData.ContainingEntryOfType<string>("Test"))
441+
.AndAlso()
442+
.ShouldReturn()
443+
.View();
444444
}
445445

446446
[Fact]
@@ -483,13 +483,13 @@ public void ContainingEntryOfTypeAndKeyShouldThrowWithIncorrectEntry()
483483
public void ContainingEntryWithValueShouldNotThrowWithCorrectEntry()
484484
{
485485
MyViewComponent<AddTempDataComponent>
486-
.Instance()
487-
.InvokedWith(c => c.Invoke())
488-
.ShouldHave()
489-
.TempData(tempData => tempData.ContainingEntryWithValue("TempValue"))
490-
.AndAlso()
491-
.ShouldReturn()
492-
.View();
486+
.Instance()
487+
.InvokedWith(c => c.Invoke())
488+
.ShouldHave()
489+
.TempData(tempData => tempData.ContainingEntryWithValue("TempValue"))
490+
.AndAlso()
491+
.ShouldReturn()
492+
.View();
493493
}
494494

495495
[Fact]
@@ -514,16 +514,16 @@ public void ContainingEntryWithValueShouldThrowWithIncorrectEntry()
514514
public void ContainingEntryWithKeyShouldNotThrowWithCorrectEntry()
515515
{
516516
MyViewComponent<AddTempDataComponent>
517-
.Instance()
518-
.InvokedWith(c => c.Invoke())
519-
.ShouldHave()
520-
.TempData(tempData => tempData
521-
.ContainingEntryWithKey("Test")
522-
.AndAlso()
523-
.ContainingEntryWithKey("Another"))
524-
.AndAlso()
525-
.ShouldReturn()
526-
.View();
517+
.Instance()
518+
.InvokedWith(c => c.Invoke())
519+
.ShouldHave()
520+
.TempData(tempData => tempData
521+
.ContainingEntryWithKey("Test")
522+
.AndAlso()
523+
.ContainingEntryWithKey("Another"))
524+
.AndAlso()
525+
.ShouldReturn()
526+
.View();
527527
}
528528

529529
[Fact]

0 commit comments

Comments
 (0)