File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
ResourceManager/Profile/Commands.Profile.Test Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 2222using System ;
2323using System . Collections . Generic ;
2424using System . Diagnostics ;
25- using System . Linq ;
26- using System . Net . NetworkInformation ;
2725using System . Security . Cryptography ;
2826using System . Text ;
2927
@@ -62,7 +60,7 @@ public string HashMacAddress
6260 {
6361 get
6462 {
65- lock ( _hashMacAddress )
63+ lock ( _lock )
6664 {
6765 if ( _hashMacAddress == string . Empty )
6866 {
Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ public void HashofNullNetworkMACAddressIsNull()
4848 metricHelper . HashMacAddress = string . Empty ;
4949 try
5050 {
51+ // verify that initialization happens only once and
52+ // there are no issues with retrieving the value
53+ Assert . Null ( metricHelper . HashMacAddress ) ;
5154 Assert . Null ( metricHelper . HashMacAddress ) ;
5255 helper . Verify ( ( f ) => f . GetMACAddress ( ) , Times . Once ) ;
5356 }
@@ -67,6 +70,7 @@ public void HashofEmptyNetworkMACAddressIsNull()
6770 metricHelper . HashMacAddress = string . Empty ;
6871 try
6972 {
73+ Assert . Null ( metricHelper . HashMacAddress ) ;
7074 Assert . Null ( metricHelper . HashMacAddress ) ;
7175 helper . Verify ( ( f ) => f . GetMACAddress ( ) , Times . Once ) ;
7276 }
@@ -86,6 +90,7 @@ public void HashMacAddressOnThrowIsNull()
8690 metricHelper . HashMacAddress = string . Empty ;
8791 try
8892 {
93+ Assert . Null ( metricHelper . HashMacAddress ) ;
8994 Assert . Null ( metricHelper . HashMacAddress ) ;
9095 helper . Verify ( ( f ) => f . GetMACAddress ( ) , Times . Once ) ;
9196 }
You can’t perform that action at this time.
0 commit comments