@@ -89,8 +89,8 @@ private static void Generate(
8989// ------------------------------------------------------------------------------
9090#nullable enable
9191namespace Resources;
92- using System.Globalization;
93- using System.Resources;
92+ using global:: System.Globalization;
93+ using global:: System.Resources;
9494
9595{ ( publicClass ? "public" : "internal" ) } { ( staticClass ? " static" : string . Empty ) } { ( partial ? " partial" : string . Empty ) } class ActivityEntrySortRuleNames
9696{{
@@ -116,10 +116,9 @@ namespace Resources;
116116 EmbeddedFilename = "Catglobe.Web.App_GlobalResources.ActivityEntrySortRuleNames" ,
117117 CustomToolNamespace = "Resources" ,
118118 ClassName = "ActivityEntrySortRuleNames" ,
119- GroupedFile = new GroupedAdditionalFile (
120- mainFile : new AdditionalTextWithHash ( new AdditionalTextStub ( "" , Text ) , NewGuid ( ) ) ,
121- subFiles : Array . Empty < AdditionalTextWithHash > ( )
122- ) ,
119+ GroupedFile = new ( [
120+ ResxFile . From ( new AdditionalTextStub ( "test.resx" , Text ) ) ! ,
121+ ] ) ,
123122 PublicClass = publicClass ,
124123 NullForgivingOperators = nullForgivingOperators ,
125124 StaticClass = staticClass ,
@@ -153,8 +152,8 @@ private static void GenerateInner(
153152// ------------------------------------------------------------------------------
154153#nullable enable
155154namespace Resources;
156- using System.Globalization;
157- using System.Resources;
155+ using global:: System.Globalization;
156+ using global:: System.Resources;
158157
159158{ ( publicClass ? "public" : "internal" ) } { ( partial ? " partial" : string . Empty ) } { ( staticClass ? " static" : string . Empty ) } class ActivityEntrySortRuleNames
160159{{{(string.IsNullOrEmpty(innerClassInstanceName) ? string.Empty : $" \n public { innerClassName} { innerClassInstanceName} { { get ; } } = new ( ) ; \n ")}
@@ -185,10 +184,9 @@ namespace Resources;
185184 ClassName = "ActivityEntrySortRuleNames" ,
186185 PublicClass = publicClass ,
187186 NullForgivingOperators = nullForgivingOperators ,
188- GroupedFile = new GroupedAdditionalFile (
189- mainFile : new AdditionalTextWithHash ( new AdditionalTextStub ( "" , Text ) , NewGuid ( ) ) ,
190- subFiles : Array . Empty < AdditionalTextWithHash > ( )
191- ) ,
187+ GroupedFile = new ( [
188+ ResxFile . From ( new AdditionalTextStub ( "test.resx" , Text ) ) ! ,
189+ ] ) ,
192190 StaticClass = staticClass ,
193191 PartialClass = partial ,
194192 StaticMembers = staticMembers ,
@@ -408,8 +406,8 @@ read any of the formats listed below.
408406// ------------------------------------------------------------------------------
409407#nullable enable
410408namespace Catglobe.Web.App_GlobalResources;
411- using System.Globalization;
412- using System.Resources;
409+ using global:: System.Globalization;
410+ using global:: System.Resources;
413411
414412public static class CommonMessages
415413{
@@ -458,10 +456,9 @@ public static class CommonMessages
458456 EmbeddedFilename = "Catglobe.Web.App_GlobalResources.CommonMessages" ,
459457 CustomToolNamespace = null ,
460458 ClassName = "CommonMessages" ,
461- GroupedFile = new GroupedAdditionalFile (
462- mainFile : new AdditionalTextWithHash ( new AdditionalTextStub ( "" , text ) , NewGuid ( ) ) ,
463- subFiles : Array . Empty < AdditionalTextWithHash > ( )
464- ) ,
459+ GroupedFile = new ( [
460+ ResxFile . From ( new AdditionalTextStub ( "test.resx" , text ) ) ! ,
461+ ] ) ,
465462 PublicClass = true ,
466463 NullForgivingOperators = false ,
467464 StaticClass = true ,
@@ -492,8 +489,8 @@ public void Generate_StringBuilder_Name_PartialXmlWorks()
492489// ------------------------------------------------------------------------------
493490#nullable enable
494491namespace Catglobe.Web.App_GlobalResources;
495- using System.Globalization;
496- using System.Resources;
492+ using global:: System.Globalization;
493+ using global:: System.Resources;
497494
498495public static class CommonMessages
499496{
@@ -514,10 +511,9 @@ public static class CommonMessages
514511 LocalNamespace = "Catglobe.Web.App_GlobalResources" ,
515512 EmbeddedFilename = "Catglobe.Web.App_GlobalResources.CommonMessages" ,
516513 CustomToolNamespace = null ,
517- GroupedFile = new GroupedAdditionalFile (
518- mainFile : new AdditionalTextWithHash ( new AdditionalTextStub ( "" , text ) , NewGuid ( ) ) ,
519- subFiles : Array . Empty < AdditionalTextWithHash > ( )
520- ) ,
514+ GroupedFile = new ( [
515+ ResxFile . From ( new AdditionalTextStub ( "test.resx" , text ) ) ! ,
516+ ] ) ,
521517 ClassName = "CommonMessages" ,
522518 PublicClass = true ,
523519 NullForgivingOperators = false ,
@@ -548,10 +544,9 @@ public void Generate_StringBuilder_Name_DuplicatedataGivesWarning()
548544 {
549545 LocalNamespace = "Catglobe.Web.App_GlobalResources" ,
550546 EmbeddedFilename = "Catglobe.Web.App_GlobalResources.CommonMessages" ,
551- GroupedFile = new GroupedAdditionalFile (
552- mainFile : new AdditionalTextWithHash ( new AdditionalTextStub ( "" , text ) , NewGuid ( ) ) ,
553- subFiles : Array . Empty < AdditionalTextWithHash > ( )
554- ) ,
547+ GroupedFile = new ( [
548+ ResxFile . From ( new AdditionalTextStub ( "test.resx" , text ) ) ! ,
549+ ] ) ,
555550 CustomToolNamespace = null ,
556551 ClassName = "CommonMessages" ,
557552 PublicClass = true ,
@@ -584,10 +579,9 @@ public void Generate_StringBuilder_Name_MemberSameAsFileGivesWarning()
584579 {
585580 LocalNamespace = "Catglobe.Web.App_GlobalResources" ,
586581 EmbeddedFilename = "Catglobe.Web.App_GlobalResources.CommonMessages" ,
587- GroupedFile = new GroupedAdditionalFile (
588- mainFile : new AdditionalTextWithHash ( new AdditionalTextStub ( "" , text ) , NewGuid ( ) ) ,
589- subFiles : Array . Empty < AdditionalTextWithHash > ( )
590- ) ,
582+ GroupedFile = new ( [
583+ ResxFile . From ( new AdditionalTextStub ( "test.resx" , text ) ) ! ,
584+ ] ) ,
591585 CustomToolNamespace = null ,
592586 ClassName = "CommonMessages" ,
593587 PublicClass = true ,
@@ -611,10 +605,4 @@ public void GetLocalNamespace_ShouldNotGenerateIllegalNamespace()
611605 ns. ShouldBe ( "root" ) ;
612606 }
613607
614- [ Fact ]
615- public void ResxFileName_ShouldNotGenerateIllegalClassnames( )
616- {
617- var ns = Utilities. GetClassNameFromPath ( "test.cshtml.resx" ) ;
618- ns. ShouldBe ( "test" ) ;
619- }
620608}
0 commit comments