@@ -1411,7 +1411,15 @@ private void VisitRecordDecl(RecordDecl recordDecl)
1411
1411
var className = GetClass ( uuidName ) ;
1412
1412
1413
1413
_testOutputBuilder . AddUsingDirective ( "System" ) ;
1414
- _testOutputBuilder . AddUsingDirective ( $ "static { GetNamespace ( className ) } .{ className } ") ;
1414
+
1415
+ if ( _config . DontUseUsingStaticsForGuidMember )
1416
+ {
1417
+ _testOutputBuilder . AddUsingDirective ( $ "{ GetNamespace ( className ) } ") ;
1418
+ }
1419
+ else
1420
+ {
1421
+ _testOutputBuilder . AddUsingDirective ( $ "static { GetNamespace ( className ) } .{ className } ") ;
1422
+ }
1415
1423
1416
1424
_testOutputBuilder . WriteIndented ( "/// <summary>Validates that the <see cref=\" Guid\" /> of the <see cref=\" " ) ;
1417
1425
_testOutputBuilder . Write ( escapedName ) ;
@@ -1440,7 +1448,13 @@ private void VisitRecordDecl(RecordDecl recordDecl)
1440
1448
_testOutputBuilder . Write ( "Is.EqualTo(" ) ;
1441
1449
}
1442
1450
1443
- _testOutputBuilder . Write ( uuidName ) ;
1451
+ var usableUuidName = uuidName ;
1452
+ if ( _config . DontUseUsingStaticsForGuidMember )
1453
+ {
1454
+ usableUuidName = $ "{ className } .{ usableUuidName } ";
1455
+ }
1456
+
1457
+ _testOutputBuilder . Write ( usableUuidName ) ;
1444
1458
1445
1459
if ( _config . GenerateTestsNUnit )
1446
1460
{
@@ -1626,12 +1640,26 @@ private void VisitRecordDecl(RecordDecl recordDecl)
1626
1640
_outputBuilder . EmitUsingDirective ( "System" ) ;
1627
1641
_outputBuilder . EmitUsingDirective ( "System.Runtime.CompilerServices" ) ;
1628
1642
1629
- _outputBuilder . EmitUsingDirective ( $ "static { GetNamespace ( uuidClassName ) } .{ uuidClassName } ") ;
1643
+ if ( _config . DontUseUsingStaticsForGuidMember )
1644
+ {
1645
+ _outputBuilder . EmitUsingDirective ( $ "{ GetNamespace ( uuidClassName ) } ") ;
1646
+ }
1647
+ else
1648
+ {
1649
+ _outputBuilder . EmitUsingDirective ( $ "static { GetNamespace ( uuidClassName ) } .{ uuidClassName } ") ;
1650
+ }
1651
+
1652
+ var usableUuidName = uuidName ;
1653
+ if ( _config . DontUseUsingStaticsForGuidMember )
1654
+ {
1655
+ usableUuidName = $ "{ uuidClassName } .{ usableUuidName } ";
1656
+ }
1657
+
1630
1658
_outputBuilder . BeginValue ( in valueDesc ) ;
1631
1659
1632
1660
var code = _outputBuilder . BeginCSharpCode ( ) ;
1633
1661
code . Write ( "(Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in " ) ;
1634
- code . Write ( uuidName ) ;
1662
+ code . Write ( usableUuidName ) ;
1635
1663
code . Write ( "))" ) ;
1636
1664
_outputBuilder . EndCSharpCode ( code ) ;
1637
1665
0 commit comments