@@ -182,6 +182,22 @@ public class PropertyTester
182182 }
183183}" ;
184184
185+ /// <summary>
186+ /// The nullable datetime property test code.
187+ /// </summary>
188+ private const string NullableDateTimePropertyTestCode = @"
189+ using System;
190+ using System.Collections.Generic;
191+ using System.Text;
192+
193+ namespace ConsoleApp4
194+ {
195+ public class PropertyTester
196+ {
197+ public DateTime? TestDateTime { get; set; }
198+ }
199+ }" ;
200+
185201 /// <summary>
186202 /// The boolean property test fix code.
187203 /// </summary>
@@ -217,6 +233,25 @@ public class PropertyTester
217233 }
218234}" ;
219235
236+ /// <summary>
237+ /// The nullable date time property test fix code.
238+ /// </summary>
239+ private const string NullableDateTimePropertyTestFixCode = @"
240+ using System;
241+ using System.Collections.Generic;
242+ using System.Text;
243+
244+ namespace ConsoleApp4
245+ {
246+ public class PropertyTester
247+ {
248+ /// <summary>
249+ /// Gets or Sets a test date time
250+ /// </summary>
251+ public DateTime? TestDateTime { get; set; }
252+ }
253+ }" ;
254+
220255 /// <summary>
221256 /// The nullable boolean property test fix code.
222257 /// </summary>
@@ -307,7 +342,8 @@ public void NoDiagnosticsShow(string testCode)
307342 [ DataRow ( BooleanPropertyTestCode , BooleanPropertyTestFixCode , 10 , 15 ) ]
308343 [ DataRow ( NullableBooleanPropertyTestCode , NullableBooleanPropertyTestFixCode , 10 , 16 ) ]
309344 [ DataRow ( ExpressionBodyPropertyTestCode , ExpressionBodyPropertyTestFixCode , 10 , 17 ) ]
310- public void ShowDiagnosticAndFix ( string testCode , string fixCode , int line , int column )
345+ [ DataRow ( NullableDateTimePropertyTestCode , NullableDateTimePropertyTestFixCode , 10 , 20 ) ]
346+ public void ShowDiagnosticAndFix ( string testCode , string fixCode , int line , int column )
311347 {
312348 var expected = new DiagnosticResult
313349 {
0 commit comments