@@ -91,12 +91,12 @@ public async Task TopicController_IndexAsync_ReturnsTopicViewResult() {
9191 } ;
9292
9393 var result = await controller . IndexAsync ( _topic . GetWebPath ( ) ) . ConfigureAwait ( false ) as TopicViewResult ;
94- var model = result . Model as PageTopicViewModel ;
94+ var model = result ? . Model as PageTopicViewModel ;
9595
9696 controller . Dispose ( ) ;
9797
9898 Assert . IsNotNull ( model ) ;
99- Assert . AreEqual < string > ( "Web_0_1_1" , model . Title ) ;
99+ Assert . AreEqual < string ? > ( "Web_0_1_1" , model ? . Title ) ;
100100
101101 }
102102
@@ -115,8 +115,8 @@ public void RedirectController_TopicRedirect_ReturnsRedirectResult() {
115115 controller . Dispose ( ) ;
116116
117117 Assert . IsNotNull ( result ) ;
118- Assert . IsTrue ( result . Permanent ) ;
119- Assert . AreEqual < string > ( "/Web/Web_1/Web_1_1/Web_1_1_1/" , result . Url ) ;
118+ Assert . IsTrue ( result ? . Permanent ?? false ) ;
119+ Assert . AreEqual < string ? > ( "/Web/Web_1/Web_1_1/Web_1_1_1/" , result ? . Url ) ;
120120
121121 }
122122
@@ -138,13 +138,13 @@ public void SitemapController_Index_ReturnsSitemapXml() {
138138 ControllerContext = new ( actionContext )
139139 } ;
140140 var result = controller . Index ( ) as ContentResult ;
141- var model = result . Content as string ;
141+ var model = result ? . Content as string ;
142142
143143 controller . Dispose ( ) ;
144144
145145 Assert . IsNotNull ( model ) ;
146- Assert . IsTrue ( model . StartsWith ( "<?xml version=\" 1.0\" encoding=\" utf-8\" standalone=\" no\" ?>" ) ) ;
147- Assert . IsTrue ( model . Contains ( "/Web/Web_1/Web_1_1/Web_1_1_1/</loc>" ) ) ;
146+ Assert . IsTrue ( model ! . StartsWith ( "<?xml version=\" 1.0\" encoding=\" utf-8\" standalone=\" no\" ?>" , StringComparison . Ordinal ) ) ;
147+ Assert . IsTrue ( model ! . Contains ( "/Web/Web_1/Web_1_1/Web_1_1_1/</loc>" , StringComparison . Ordinal ) ) ;
148148
149149 }
150150
@@ -177,20 +177,20 @@ public void SitemapController_Index_ExcludesContentTypes() {
177177 ControllerContext = new ( actionContext )
178178 } ;
179179 var result = controller . Index ( false , true ) as ContentResult ;
180- var model = result . Content as string ;
180+ var model = result ? . Content as string ;
181181
182182 controller . Dispose ( ) ;
183183
184184 Assert . IsNotNull ( model ) ;
185- Assert . IsTrue ( model . Contains ( "<DataObject type=\" Attributes\" >" ) ) ;
186- Assert . IsFalse ( model . Contains ( "<DataObject type=\" List\" >" ) ) ;
187- Assert . IsFalse ( model . Contains ( "<DataObject type=\" Container\" >" ) ) ;
188- Assert . IsFalse ( model . Contains ( "<DataObject type=\" PageGroup\" >" ) ) ;
189- Assert . IsTrue ( model . Contains ( "/Web/Web_0/Web_0_0/Web_0_0_1/</loc>" ) ) ;
190- Assert . IsTrue ( model . Contains ( "/Web/Web_1/Web_1_1/Web_1_1_0/</loc>" ) ) ;
191- Assert . IsFalse ( model . Contains ( "/Web/Web_1/Web_1_0/Web_1_0_0/</loc>" ) ) ;
192- Assert . IsFalse ( model . Contains ( "/Web/Web_1/Web_1_1/Web_1_1_1/</loc>" ) ) ;
193- Assert . IsFalse ( model . Contains ( "/Web/Web_0/Web_0_0/</loc>" ) ) ;
185+ Assert . IsTrue ( model ! . Contains ( "<DataObject type=\" Attributes\" >" , StringComparison . Ordinal ) ) ;
186+ Assert . IsFalse ( model ! . Contains ( "<DataObject type=\" List\" >" , StringComparison . Ordinal ) ) ;
187+ Assert . IsFalse ( model ! . Contains ( "<DataObject type=\" Container\" >" , StringComparison . Ordinal ) ) ;
188+ Assert . IsFalse ( model ! . Contains ( "<DataObject type=\" PageGroup\" >" , StringComparison . Ordinal ) ) ;
189+ Assert . IsTrue ( model ! . Contains ( "/Web/Web_0/Web_0_0/Web_0_0_1/</loc>" , StringComparison . Ordinal ) ) ;
190+ Assert . IsTrue ( model ! . Contains ( "/Web/Web_1/Web_1_1/Web_1_1_0/</loc>" , StringComparison . Ordinal ) ) ;
191+ Assert . IsFalse ( model ! . Contains ( "/Web/Web_1/Web_1_0/Web_1_0_0/</loc>" , StringComparison . Ordinal ) ) ;
192+ Assert . IsFalse ( model ! . Contains ( "/Web/Web_1/Web_1_1/Web_1_1_1/</loc>" , StringComparison . Ordinal ) ) ;
193+ Assert . IsFalse ( model ! . Contains ( "/Web/Web_0/Web_0_0/</loc>" , StringComparison . Ordinal ) ) ;
194194
195195 }
196196
@@ -220,15 +220,15 @@ public void SitemapController_Index_ExcludesAttributes() {
220220 ControllerContext = new ( actionContext )
221221 } ;
222222 var result = controller . Index ( false , true ) as ContentResult ;
223- var model = result . Content as string ;
223+ var model = result ? . Content as string ;
224224
225225 controller . Dispose ( ) ;
226226
227227 Assert . IsNotNull ( model ) ;
228- Assert . IsTrue ( model . Contains ( "<Attribute name=\" Title\" >" ) ) ;
229- Assert . IsTrue ( model . Contains ( "<Attribute name=\" LastModified\" >" ) ) ;
230- Assert . IsFalse ( model . Contains ( "<Attribute name=\" Body\" >" ) ) ;
231- Assert . IsFalse ( model . Contains ( "<Attribute name=\" IsHidden\" >" ) ) ;
228+ Assert . IsTrue ( model ! . Contains ( "<Attribute name=\" Title\" >" , StringComparison . Ordinal ) ) ;
229+ Assert . IsTrue ( model ! . Contains ( "<Attribute name=\" LastModified\" >" , StringComparison . Ordinal ) ) ;
230+ Assert . IsFalse ( model ! . Contains ( "<Attribute name=\" Body\" >" , StringComparison . Ordinal ) ) ;
231+ Assert . IsFalse ( model ! . Contains ( "<Attribute name=\" IsHidden\" >" , StringComparison . Ordinal ) ) ;
232232
233233 }
234234
0 commit comments