File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Tests/NFUnitTestSystemLib Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -419,15 +419,29 @@ public void Ctor_UInt_UShort_UShort_Byte_Byte_Byte_Byte_Byte_Byte_Byte_Byte()
419419 [ TestMethod ]
420420 public void NewGuid ( )
421421 {
422+ // generate a new Guid
422423 Guid guid1 = Guid . NewGuid ( ) ;
423424
425+ OutputHelper . WriteLine ( $ "Guid1: { guid1 } ") ;
426+
427+ // check that the guid is not empty
424428 Assert . AreNotEqual ( Guid . Empty , guid1 ) ;
429+ // check version 4
425430 Assert . IsTrue ( ( guid1 . ToByteArray ( ) [ 7 ] & 0xF0 ) == 0x40 ) ;
431+ // check variant
432+ Assert . IsTrue ( ( guid1 . ToByteArray ( ) [ 8 ] & 0xC0 ) == 0x80 ) ;
426433
434+ // go for another one
427435 Guid guid2 = Guid . NewGuid ( ) ;
428436
437+ OutputHelper . WriteLine ( $ "Guid2: { guid2 } ") ;
438+
439+ // check that the guid is not empty
429440 Assert . AreNotEqual ( guid1 , guid2 ) ;
441+ // check version 4
430442 Assert . IsTrue ( ( guid2 . ToByteArray ( ) [ 7 ] & 0xF0 ) == 0x40 ) ;
443+ // check variant
444+ Assert . IsTrue ( ( guid2 . ToByteArray ( ) [ 8 ] & 0xC0 ) == 0x80 ) ;
431445 }
432446
433447 [ TestMethod ]
You can’t perform that action at this time.
0 commit comments