Skip to content

Commit fe2e58c

Browse files
committed
Fixed unit tests. Cleanup...
1 parent 9708b5c commit fe2e58c

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

ColorSetKit/ColorSet.cs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ public static ColorSet Shared
4545
{
4646
if( SharedInstance == null )
4747
{
48-
if( !( Assembly.GetEntryAssembly() is Assembly assembly ) )
48+
Assembly assembly = Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly();
49+
50+
if( assembly == null )
4951
{
5052
throw new ApplicationException( "Cannot get entry assembly" );
5153
}
@@ -65,14 +67,7 @@ public static ColorSet Shared
6567
{
6668
System.Resources.ResourceManager manager = new System.Resources.ResourceManager( name.Name + ".Properties.Resources", assembly );
6769

68-
if( !( manager.GetObject( "Colors" ) is byte[] data ) || data.Length == 0 )
69-
{
70-
SharedInstance = new ColorSet();
71-
}
72-
else
73-
{
74-
SharedInstance = new ColorSet( new Data( data ) );
75-
}
70+
SharedInstance = !( manager.GetObject( "Colors" ) is byte[] data ) || data.Length == 0 ? new ColorSet() : new ColorSet( new Data( data ) );
7671
}
7772
}
7873

@@ -166,10 +161,7 @@ public ColorSet( Data data )
166161

167162
public ColorPair this[ string key ]
168163
{
169-
get
170-
{
171-
return this.ColorNamed( key );
172-
}
164+
get => this.ColorNamed( key );
173165
}
174166

175167
public ColorPair ColorNamed( string name )

ColorSetKit/Data.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ public partial class Data
3434
{
3535
public ulong Count
3636
{
37-
get
38-
{
39-
return ( ulong )( this.Bytes.Count );
40-
}
37+
get => ( ulong )( this.Bytes.Count );
4138
}
4239

4340
private List< byte > Bytes

0 commit comments

Comments
 (0)