File tree 2 files changed +6
-3
lines changed
ResourceManager/Profile/Commands.Profile.Test 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 22
22
using System ;
23
23
using System . Collections . Generic ;
24
24
using System . Diagnostics ;
25
- using System . Linq ;
26
- using System . Net . NetworkInformation ;
27
25
using System . Security . Cryptography ;
28
26
using System . Text ;
29
27
@@ -62,7 +60,7 @@ public string HashMacAddress
62
60
{
63
61
get
64
62
{
65
- lock ( _hashMacAddress )
63
+ lock ( _lock )
66
64
{
67
65
if ( _hashMacAddress == string . Empty )
68
66
{
Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ public void HashofNullNetworkMACAddressIsNull()
48
48
metricHelper . HashMacAddress = string . Empty ;
49
49
try
50
50
{
51
+ // verify that initialization happens only once and
52
+ // there are no issues with retrieving the value
53
+ Assert . Null ( metricHelper . HashMacAddress ) ;
51
54
Assert . Null ( metricHelper . HashMacAddress ) ;
52
55
helper . Verify ( ( f ) => f . GetMACAddress ( ) , Times . Once ) ;
53
56
}
@@ -67,6 +70,7 @@ public void HashofEmptyNetworkMACAddressIsNull()
67
70
metricHelper . HashMacAddress = string . Empty ;
68
71
try
69
72
{
73
+ Assert . Null ( metricHelper . HashMacAddress ) ;
70
74
Assert . Null ( metricHelper . HashMacAddress ) ;
71
75
helper . Verify ( ( f ) => f . GetMACAddress ( ) , Times . Once ) ;
72
76
}
@@ -86,6 +90,7 @@ public void HashMacAddressOnThrowIsNull()
86
90
metricHelper . HashMacAddress = string . Empty ;
87
91
try
88
92
{
93
+ Assert . Null ( metricHelper . HashMacAddress ) ;
89
94
Assert . Null ( metricHelper . HashMacAddress ) ;
90
95
helper . Verify ( ( f ) => f . GetMACAddress ( ) , Times . Once ) ;
91
96
}
You can’t perform that action at this time.
0 commit comments