File tree Expand file tree Collapse file tree 6 files changed +27
-22
lines changed
Supernova.Enum.Generators Expand file tree Collapse file tree 6 files changed +27
-22
lines changed Original file line number Diff line number Diff line change 1+ ## 1.0.12
2+ Breaking changes
3+ - rename StringToFast to ToStringFast
14## 1.0.11
25- Add method GetValuesFast
36- Add method GetNamesFast
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ For example:
4040``` csharp
4141 public static class UserTypeTestEnumExtensions
4242 {
43- public static string StringToFast (this UnitTests .UserTypeTest states )
43+ public static string ToStringFast (this UnitTests .UserTypeTest states )
4444 {
4545 return states switch
4646 {
@@ -110,7 +110,7 @@ You do not see this file inside the project. But you can use it.
110110
111111Usage
112112``` csharp
113- var stringEnum = UserTypeTest .Men .StringToFast (); // Men;
113+ var stringEnum = UserTypeTest .Men .ToStringFast (); // Men;
114114
115115var isDefined = UserTypeTestEnumExtensions .IsDefinedFast (UserType .Men ); // true;
116116
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public static class SourceGeneratorHelper
1313
1414 public const string NameSpace = "EnumFastToStringGenerated" ;
1515 public const string AttributeName = "EnumGenerator" ;
16- public const string ExtensionMethodNameToString = "StringToFast " ;
16+ public const string ExtensionMethodNameToString = "ToStringFast " ;
1717 public const string ExtensionMethodNameIsDefined = "IsDefinedFast" ;
1818 public const string ExtensionMethodNameToDisplay = "ToDisplayFast" ;
1919 public const string ExtensionMethodNameGetValues = "GetValuesFast" ;
Original file line number Diff line number Diff line change 55 <PackageId >Supernova.Enum.Generators</PackageId >
66 <GeneratePackageOnBuild >true</GeneratePackageOnBuild >
77 <GenerateAssemblyInfo >false</GenerateAssemblyInfo >
8- <Version >1.0.11 </Version >
9- <PackageVersion >1.0.11 </PackageVersion >
10- <AssemblyVersion >1.0.11 </AssemblyVersion >
8+ <Version >1.0.12 </Version >
9+ <PackageVersion >1.0.12 </PackageVersion >
10+ <AssemblyVersion >1.0.12 </AssemblyVersion >
1111 <PackageReadmeFile >README.md</PackageReadmeFile >
1212 <PackageIcon >icon.png</PackageIcon >
13- <PackageReleaseNotes >v1.0.11
14- - Add method GetValuesFast
15- - Add method GetNamesFast
16- - Add method GetLengthFast</PackageReleaseNotes >
13+ <PackageReleaseNotes >
14+ v1.0.12
15+ Breaking changes
16+ - rename StringToFast to ToStringFast
17+ </PackageReleaseNotes >
1718 </PropertyGroup >
1819
1920 <ItemGroup >
Original file line number Diff line number Diff line change 1- using System ;
2- using System . ComponentModel . DataAnnotations ;
3- using System . Linq ;
4- using System . Reflection ;
5- using System . Text . RegularExpressions ;
6- using BenchmarkDotNet . Analysers ;
1+ using BenchmarkDotNet . Analysers ;
72using BenchmarkDotNet . Attributes ;
83using BenchmarkDotNet . Columns ;
94using BenchmarkDotNet . Configs ;
1510using BenchmarkDotNet . Running ;
1611using EnumFastToStringGenerated ;
1712using Perfolizer . Horology ;
13+ using System ;
14+ using System . ComponentModel . DataAnnotations ;
15+ using System . Linq ;
16+ using System . Reflection ;
17+ using System . Text . RegularExpressions ;
1818
1919namespace Console . Test . Benchmark ;
2020
@@ -70,7 +70,7 @@ public string NativeToString()
7070 public string FasterToString ( )
7171 {
7272 var state = UserType . Men ;
73- return state . StringToFast ( ) ;
73+ return state . ToStringFast ( ) ;
7474 }
7575
7676 [ Benchmark ]
Original file line number Diff line number Diff line change 1- using System . ComponentModel . DataAnnotations ;
2- using EnumFastToStringGenerated ;
1+ using EnumFastToStringGenerated ;
32using FluentAssertions ;
43using Microsoft . VisualStudio . TestTools . UnitTesting ;
4+ using System ;
5+ using System . ComponentModel . DataAnnotations ;
56
67namespace UnitTests ;
78
@@ -30,7 +31,7 @@ public void TestEnumDefined()
3031 [ TestMethod ]
3132 public void TestEnumToString ( )
3233 {
33- var menString = UserTypeTest . Men . StringToFast ( ) ;
34+ var menString = UserTypeTest . Men . ToStringFast ( ) ;
3435
3536 Assert . AreEqual ( "Men" , menString ) ;
3637 }
@@ -79,7 +80,7 @@ public void TestEnumGetValues()
7980 public void TestEnumGetLength ( )
8081 {
8182 var length = UserTypeTestEnumExtensions . GetLengthFast ( ) ;
82-
83- Assert . AreEqual ( 3 , length ) ;
83+
84+ Assert . AreEqual ( Enum . GetValues < UserTypeTest > ( ) . Length , length ) ;
8485 }
8586}
You can’t perform that action at this time.
0 commit comments