File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
MyWebApi.Tests/BuildersTests/ActionsTests Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -73,5 +73,31 @@ public void ShouldHaveInvalidModelStateShouldThrowExceptionWithValidRequestModel
7373 . Calling ( c => c . ModelStateCheck ( requestModel ) )
7474 . ShouldHaveInvalidModelState ( ) ;
7575 }
76+
77+ [ Test ]
78+ public void AndShouldWorkCorrectlyWithValidModelState ( )
79+ {
80+ var requestModel = TestObjectFactory . GetValidRequestModel ( ) ;
81+
82+ MyWebApi
83+ . Controller < WebApiController > ( )
84+ . Calling ( c => c . ModelStateCheck ( requestModel ) )
85+ . ShouldHaveValidModelState ( )
86+ . And ( )
87+ . ShouldReturnOk ( ) ;
88+ }
89+
90+ [ Test ]
91+ public void AndShouldWorkCorrectlyWithInvalidModelState ( )
92+ {
93+ var requestModelWithErrors = TestObjectFactory . GetRequestModelWithErrors ( ) ;
94+
95+ MyWebApi
96+ . Controller < WebApiController > ( )
97+ . Calling ( c => c . ModelStateCheck ( requestModelWithErrors ) )
98+ . ShouldHaveInvalidModelState ( )
99+ . And ( )
100+ . ShouldReturnOk ( ) ;
101+ }
76102 }
77103}
You can’t perform that action at this time.
0 commit comments