File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
exercises/concept/authentication-system Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,12 @@ public void GetAdmin()
18
18
[ Task ( 4 ) ]
19
19
public void CheckAdminCannotBeTampered ( )
20
20
{
21
- var admin = new Identity { EyeColor = "green" , Email = "admin@ex.ism" } ;
21
+ var adminEmail = "admin@ex.ism" ;
22
+ var admin = new Identity { EyeColor = "green" , Email = adminEmail } ;
22
23
var authenticator = new Authenticator ( admin ) ;
23
24
var tamperedAdmin = authenticator . Admin ;
24
25
tamperedAdmin . Email = "admin@hack.ed" ;
25
- Assert . NotEqual ( tamperedAdmin . Email , authenticator . Admin . Email ) ;
26
+ Assert . Equal ( adminEmail , authenticator . Admin . Email ) ;
26
27
}
27
28
28
29
[ Fact ]
@@ -44,13 +45,6 @@ public void CheckDevelopersCannotBeTampered()
44
45
IDictionary < string , Identity > devs = authenticator . GetDevelopers ( ) ;
45
46
46
47
Identity tamperedDev = new Identity { EyeColor = "grey" , Email = "anders@hack.ed" } ;
47
- try
48
- {
49
- devs [ "Anders" ] = tamperedDev ;
50
- Assert . True ( false , "Unexpected change to developers list." ) ;
51
- } catch ( NotSupportedException )
52
- {
53
- Assert . True ( true ) ;
54
- }
48
+ Assert . Throws < NotSupportedException > ( ( ) => devs [ "Anders" ] = tamperedDev ) ;
55
49
}
56
50
}
You can’t perform that action at this time.
0 commit comments