File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
src/Certify.Tests/Certify.Core.Tests.Unit/Tests Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1111using Microsoft . VisualStudio . TestTools . UnitTesting ;
1212using Moq ;
1313using Moq . Protected ;
14+ using Newtonsoft . Json ;
1415
1516namespace Certify . Core . Tests . Unit
1617{
@@ -218,5 +219,28 @@ public async Task TestAcmeDirectoryRateLimitWithRetry()
218219 Assert . IsNotNull ( dir ) ;
219220 Assert . IsNotNull ( dir . NewOrder ) ;
220221 }
222+
223+ [ TestMethod , Description ( "Test Renewal Info DateTime Precision" ) ]
224+ public async Task TestAcmeRenewalInfoDateTimePrecision ( )
225+ {
226+ var exampleJson = """
227+ {
228+ "suggestedWindow": {
229+ "start": "2021-01-03T00:01:00.12345678999Z",
230+ "end": "2021-01-07T00:01:00.12345678999Z"
231+ },
232+ "explanationURL": "https://example.com/docs/ari"
233+ }
234+
235+ """ ;
236+
237+ var result = JsonConvert . DeserializeObject < AcmeRenewalInfo > ( exampleJson ) ;
238+
239+ Assert . IsTrue ( result . SuggestedWindow . Start . Value . Millisecond == 123 ) ;
240+
241+ #if NET9_0_OR_GREATER
242+ Assert . IsTrue ( result . SuggestedWindow . Start . Value . Nanosecond == 800 ) ;
243+ #endif
244+ }
221245 }
222246}
You can’t perform that action at this time.
0 commit comments