This repository was archived by the owner on Nov 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +27
-28
lines changed
ServiceStack.Text.EnumMemberSerializer.UnitTests
ServiceStack.Text.EnumMemberSerializer Expand file tree Collapse file tree 3 files changed +27
-28
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
3- using System . Collections . ObjectModel ;
43using System . Linq ;
54using System . Reflection ;
6- using System . Reflection . Emit ;
75using SomeOtherNamespace ;
86using Xunit ;
97
@@ -92,27 +90,10 @@ public void GetPublicEnums_ListOfNullAssemblies_ReturnsEmtpyTypeList()
9290 public void GetPublicEnums_FilterThrowsException_ExceptionPassedUpInAggregate ( )
9391 {
9492 var assemblies = new List < Assembly > { Assembly . GetExecutingAssembly ( ) } ;
95- Assert . Throws < AggregateException > (
93+ Assert . Throws < NotImplementedException > (
9694 ( ) =>
9795 {
98- try
99- {
100- assemblies . GetPublicEnums ( s => { throw new NotImplementedException ( ) ; } ) ;
101- }
102- catch ( AggregateException ex )
103- {
104- Assert . Equal (
105- 2 ,
106- ex . InnerExceptions
107- . ToList ( )
108- . FindAll ( x => x . GetType ( ) == typeof ( NotImplementedException ) )
109- . Count ) ;
110- throw ;
111- }
112- catch ( Exception )
113- {
114- Assert . True ( false , "Expected AggregateException" ) ;
115- }
96+ assemblies . GetPublicEnums ( s => { throw new NotImplementedException ( ) ; } ) ;
11697 } ) ;
11798 }
11899 }
Original file line number Diff line number Diff line change @@ -23,15 +23,16 @@ public static HashSet<Type> GetPublicEnums(this ICollection<Assembly> assemblies
2323
2424 foreach ( var assembly in assemblies )
2525 {
26- if ( assembly ! = null )
26+ if ( assembly = = null )
2727 {
28- var assemblyPublicEnums =
29- ( from publicEnumType in assembly . GetTypes ( ) . GetPublicEnums ( ) . AsParallel ( )
30- where enumNamespaceFilter ( publicEnumType . Namespace )
31- select publicEnumType
32- ) . ToList ( ) ;
33- enumTypes . AddRange ( assemblyPublicEnums ) ;
28+ continue ;
3429 }
30+ var assemblyPublicEnums =
31+ ( from publicEnumType in assembly . GetTypes ( ) . GetPublicEnums ( )
32+ where enumNamespaceFilter ( publicEnumType . Namespace )
33+ select publicEnumType
34+ ) . ToList ( ) ;
35+ enumTypes . AddRange ( assemblyPublicEnums ) ;
3536 }
3637 return new HashSet < Type > ( enumTypes ) ;
3738 }
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <package >
3+ <metadata >
4+ <id >$id$</id >
5+ <version >$version$</version >
6+ <title >$title$</title >
7+ <authors >$author$</authors >
8+ <owners >$author$</owners >
9+ <licenseUrl >https://github.com/Chatham/ServiceStack.Text.EnumMemberSerializer/blob/master/LICENSE</licenseUrl >
10+ <projectUrl >https://github.com/Chatham/ServiceStack.Text.EnumMemberSerializer</projectUrl >
11+ <iconUrl >http://www.servicestack.net/logo-100x100.png</iconUrl >
12+ <requireLicenseAcceptance >false</requireLicenseAcceptance >
13+ <description >$description$</description >
14+ <copyright >Copyright © Anthony Carl, Chatham Financial Corp. 2013</copyright >
15+ <tags >Serializer TEXT PrettyPrint ServiceStack JSON Service</tags >
16+ </metadata >
17+ </package >
You can’t perform that action at this time.
0 commit comments