Skip to content

Commit bf3e1bb

Browse files
committed
Cleanup of test setups (#359)
1 parent 741a8cf commit bf3e1bb

15 files changed

Lines changed: 87 additions & 88 deletions

File tree

test/MyTested.AspNetCore.Mvc.Controllers.Attributes.Test/BuildersTests/AttributesTests/ActionAttributesTestBuilderTests.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
using System.Collections.Generic;
44
using Exceptions;
55
using Microsoft.AspNetCore.Mvc;
6-
using Setups.Pipelines;
76
using Setups;
87
using Setups.Controllers;
98
using Setups.Models;
109
using Setups.ActionFilters;
10+
using Setups.Pipeline;
1111
using Xunit;
1212

1313
using HttpMethod = System.Net.Http.HttpMethod;
@@ -559,7 +559,7 @@ public void SpecifyingMiddlewareShouldNotThrowExceptionWithCorrectAttribute()
559559
.Calling(c => c.VariousAttributesAction())
560560
.ShouldHave()
561561
.ActionAttributes(attributes => attributes
562-
.SpecifyingMiddleware(typeof(MyPipeline)));
562+
.SpecifyingMiddleware(typeof(Pipeline)));
563563
}
564564

565565
[Fact]
@@ -573,7 +573,7 @@ public void SpecifyingMiddlewareShouldThrowExceptionWithMissingAttribute()
573573
.Calling(c => c.NormalActionWithAttributes())
574574
.ShouldHave()
575575
.ActionAttributes(attributes => attributes
576-
.SpecifyingMiddleware(typeof(MyPipeline)));
576+
.SpecifyingMiddleware(typeof(Pipeline)));
577577
},
578578
"When calling NormalActionWithAttributes action in MvcController expected action to have MiddlewareFilterAttribute, but in fact such was not found.");
579579
}
@@ -589,7 +589,7 @@ public void SpecifyingMiddlewareShouldThrowExceptionWithCorrectAttributeAndWrong
589589
.Calling(c => c.VariousAttributesAction())
590590
.ShouldHave()
591591
.ActionAttributes(attributes => attributes
592-
.SpecifyingMiddleware(typeof(MyOtherPipeline)));
592+
.SpecifyingMiddleware(typeof(OtherPipeline)));
593593
},
594594
"When calling VariousAttributesAction action in MvcController expected action to have MiddlewareFilterAttribute with 'MyOtherPipeline' type, but in fact found 'MyPipeline'.");
595595
}
@@ -603,7 +603,7 @@ public void SpecifyingMiddlewareShouldNotThrowExceptionWithCorrectAttributeConfi
603603
.ShouldHave()
604604
.ActionAttributes(attributes => attributes
605605
.SpecifyingMiddleware(middleware => middleware
606-
.OfType(typeof(MyPipeline))));
606+
.OfType(typeof(Pipeline))));
607607
}
608608

609609
[Fact]
@@ -618,7 +618,7 @@ public void SpecifyingMiddlewareShouldThrowExceptionWithWrongConfigurationType()
618618
.ShouldHave()
619619
.ActionAttributes(attributes => attributes
620620
.SpecifyingMiddleware(middleware => middleware
621-
.OfType(typeof(MyOtherPipeline))));
621+
.OfType(typeof(OtherPipeline))));
622622
},
623623
"When calling VariousAttributesAction action in MvcController expected action to have MiddlewareFilterAttribute with 'MyOtherPipeline' type, but in fact found 'MyPipeline'.");
624624
}
@@ -659,7 +659,7 @@ public void SpecifyingMiddlewareShouldNotThrowExceptionWithCorrectAttributeConfi
659659
.ShouldHave()
660660
.ActionAttributes(attributes => attributes
661661
.SpecifyingMiddleware(middleware => middleware
662-
.OfType(typeof(MyPipeline))
662+
.OfType(typeof(Pipeline))
663663
.AndAlso()
664664
.WithOrder(2)));
665665
}
@@ -676,7 +676,7 @@ public void SpecifyingMiddlewareShouldThrowExceptionWithCorrectAttributeConfigTy
676676
.ShouldHave()
677677
.ActionAttributes(attributes => attributes
678678
.SpecifyingMiddleware(middleware => middleware
679-
.OfType(typeof(MyPipeline))
679+
.OfType(typeof(Pipeline))
680680
.AndAlso()
681681
.WithOrder(1)));
682682
},
@@ -693,7 +693,7 @@ public void WithTypeFilterShouldNotThrowExceptionWithCorrectAttribute()
693693
.Calling(c => c.VariousAttributesAction())
694694
.ShouldHave()
695695
.ActionAttributes(attributes => attributes
696-
.WithTypeFilter(typeof(MyActionFilterWithArgs)));
696+
.WithTypeFilter(typeof(CustomActionFilterWithArgs)));
697697

698698
MyApplication.StartsFrom<DefaultStartup>();
699699
}
@@ -711,7 +711,7 @@ public void WithTypeFilterShouldThrowExceptionWithMissingAttribute()
711711
.Calling(c => c.NormalActionWithAttributes())
712712
.ShouldHave()
713713
.ActionAttributes(attributes => attributes
714-
.WithTypeFilter(typeof(MyActionFilterWithArgs)));
714+
.WithTypeFilter(typeof(CustomActionFilterWithArgs)));
715715
},
716716
"When calling NormalActionWithAttributes action in MvcController expected action to have TypeFilterAttribute, but in fact such was not found.");
717717

@@ -731,7 +731,7 @@ public void WithTypeFilterShouldThrowExceptionWithCorrectAttributeAndWrongImplem
731731
.Calling(c => c.VariousAttributesAction())
732732
.ShouldHave()
733733
.ActionAttributes(attributes => attributes
734-
.WithTypeFilter(typeof(MyOtherActionFilterWithArgs)));
734+
.WithTypeFilter(typeof(OtherActionFilterWithArgs)));
735735
},
736736
"When calling VariousAttributesAction action in MvcController expected action to have TypeFilterAttribute with 'MyOtherActionFilterWithArgs' type, but in fact found 'MyActionFilterWithArgs'.");
737737

@@ -749,7 +749,7 @@ public void WithTypeFilterShouldNotThrowExceptionWithCorrectImplementationType()
749749
.ShouldHave()
750750
.ActionAttributes(attributes => attributes
751751
.WithTypeFilter(filter => filter
752-
.OfType(typeof(MyActionFilterWithArgs))));
752+
.OfType(typeof(CustomActionFilterWithArgs))));
753753

754754
MyApplication.StartsFrom<DefaultStartup>();
755755
}
@@ -768,7 +768,7 @@ public void WithTypeFilterShouldThrowExceptionWithWrongImplementationType()
768768
.ShouldHave()
769769
.ActionAttributes(attributes => attributes
770770
.WithTypeFilter(filter => filter
771-
.OfType(typeof(MyOtherActionFilterWithArgs))));
771+
.OfType(typeof(OtherActionFilterWithArgs))));
772772
},
773773
"When calling VariousAttributesAction action in MvcController expected action to have TypeFilterAttribute with 'MyOtherActionFilterWithArgs' type, but in fact found 'MyActionFilterWithArgs'.");
774774

@@ -821,7 +821,7 @@ public void WithTypeFilterShouldNotThrowExceptionWithCorrectAttributeImplementat
821821
.ShouldHave()
822822
.ActionAttributes(attributes => attributes
823823
.WithTypeFilter(filter => filter
824-
.OfType(typeof(MyActionFilterWithArgs))
824+
.OfType(typeof(CustomActionFilterWithArgs))
825825
.AndAlso()
826826
.WithOrder(2)));
827827

@@ -842,7 +842,7 @@ public void WithTypeFilterShouldThrowExceptionWithCorrectAttributeImplementation
842842
.ShouldHave()
843843
.ActionAttributes(attributes => attributes
844844
.WithTypeFilter(filter => filter
845-
.OfType(typeof(MyActionFilterWithArgs))
845+
.OfType(typeof(CustomActionFilterWithArgs))
846846
.AndAlso()
847847
.WithOrder(1)));
848848
},
@@ -862,7 +862,7 @@ public void WithTypeFilterShouldNotThrowExceptionWithCorrectAttributeImplementat
862862
.ShouldHave()
863863
.ActionAttributes(attributes => attributes
864864
.WithTypeFilter(filter => filter
865-
.OfType(typeof(MyActionFilterWithArgs))
865+
.OfType(typeof(CustomActionFilterWithArgs))
866866
.AndAlso()
867867
.WithArguments(new object[]
868868
{
@@ -886,7 +886,7 @@ public void WithTypeFilterShouldThrowExceptionWithCorrectAttributeImplementation
886886
.ShouldHave()
887887
.ActionAttributes(attributes => attributes
888888
.WithTypeFilter(filter => filter
889-
.OfType(typeof(MyActionFilterWithArgs))
889+
.OfType(typeof(CustomActionFilterWithArgs))
890890
.AndAlso()
891891
.WithArguments(new object[]
892892
{
@@ -949,7 +949,7 @@ public void WithServiceFilterShouldNotThrowExceptionWithCorrectAttribute()
949949
.Calling(c => c.VariousAttributesAction())
950950
.ShouldHave()
951951
.ActionAttributes(attributes => attributes
952-
.WithServiceFilter(typeof(MyActionFilter)));
952+
.WithServiceFilter(typeof(CustomActionFilter)));
953953

954954
MyApplication.StartsFrom<DefaultStartup>();
955955
}
@@ -967,7 +967,7 @@ public void WithServiceFilterShouldThrowExceptionWithMissingAttribute()
967967
.Calling(c => c.NormalActionWithAttributes())
968968
.ShouldHave()
969969
.ActionAttributes(attributes => attributes
970-
.WithServiceFilter(typeof(MyActionFilter)));
970+
.WithServiceFilter(typeof(CustomActionFilter)));
971971
},
972972
"When calling NormalActionWithAttributes action in MvcController expected action to have ServiceFilterAttribute, but in fact such was not found.");
973973

@@ -987,7 +987,7 @@ public void WithServiceFilterShouldThrowExceptionWithCorrectAttributeAndWrongCon
987987
.Calling(c => c.VariousAttributesAction())
988988
.ShouldHave()
989989
.ActionAttributes(attributes => attributes
990-
.WithServiceFilter(typeof(MyOtherActionFilter)));
990+
.WithServiceFilter(typeof(OtherActionFilter)));
991991
},
992992
"When calling VariousAttributesAction action in MvcController expected action to have ServiceFilterAttribute with 'MyOtherActionFilter' type, but in fact found 'MyActionFilter'.");
993993

@@ -1005,7 +1005,7 @@ public void WithServiceFilterShouldNotThrowExceptionWithCorrectServiceFilterType
10051005
.ShouldHave()
10061006
.ActionAttributes(attributes => attributes
10071007
.WithServiceFilter(filter => filter
1008-
.OfType(typeof(MyActionFilter))));
1008+
.OfType(typeof(CustomActionFilter))));
10091009

10101010
MyApplication.StartsFrom<DefaultStartup>();
10111011
}
@@ -1024,7 +1024,7 @@ public void WithServiceFilterShouldThrowExceptionWithWrongServiceFilterType()
10241024
.ShouldHave()
10251025
.ActionAttributes(attributes => attributes
10261026
.WithServiceFilter(filter => filter
1027-
.OfType(typeof(MyOtherActionFilter))));
1027+
.OfType(typeof(OtherActionFilter))));
10281028
},
10291029
"When calling VariousAttributesAction action in MvcController expected action to have ServiceFilterAttribute with 'MyOtherActionFilter' type, but in fact found 'MyActionFilter'.");
10301030

@@ -1077,7 +1077,7 @@ public void WithServiceFilterShouldNotThrowExceptionWithCorrectAttributeServiceT
10771077
.ShouldHave()
10781078
.ActionAttributes(attributes => attributes
10791079
.WithServiceFilter(filter => filter
1080-
.OfType(typeof(MyActionFilter))
1080+
.OfType(typeof(CustomActionFilter))
10811081
.AndAlso()
10821082
.WithOrder(2)));
10831083

@@ -1098,7 +1098,7 @@ public void WithServiceFilterShouldThrowExceptionWithCorrectAttributeServiceType
10981098
.ShouldHave()
10991099
.ActionAttributes(attributes => attributes
11001100
.WithServiceFilter(filter => filter
1101-
.OfType(typeof(MyActionFilter))
1101+
.OfType(typeof(CustomActionFilter))
11021102
.AndAlso()
11031103
.WithOrder(1)));
11041104
},

0 commit comments

Comments
 (0)