File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/Servers/HttpSys/test/FunctionalTests/Listener Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -126,17 +126,18 @@ public async Task Server_SetRejectionVerbosityLevel_Success()
126
126
}
127
127
128
128
[ ConditionalFact ]
129
- [ QuarantinedTest ( "https://github.com/dotnet/aspnetcore/pull/20718#issuecomment-618758634" ) ]
130
129
public void Server_RegisterUnavailablePrefix_ThrowsActionableHttpSysException ( )
131
130
{
131
+ using var server1 = Utilities . CreateHttpServer ( out var address1 ) ;
132
+
132
133
var options = new HttpSysOptions ( ) ;
133
- options . UrlPrefixes . Add ( UrlPrefix . Create ( "http" , "example.org" , "8080" , "" ) ) ;
134
- var listener = new HttpSysListener ( options , new LoggerFactory ( ) ) ;
134
+ options . UrlPrefixes . Add ( address1 ) ;
135
+ using var listener = new HttpSysListener ( options , new LoggerFactory ( ) ) ;
135
136
136
137
var exception = Assert . Throws < HttpSysException > ( ( ) => listener . Start ( ) ) ;
137
138
138
- Assert . Equal ( ( int ) UnsafeNclNativeMethods . ErrorCodes . ERROR_ACCESS_DENIED , exception . ErrorCode ) ;
139
- Assert . Contains ( $@ "netsh http add urlacl url=http://example.org:8080/ user= { Environment . UserDomainName } \ { Environment . UserName } ", exception . Message ) ;
139
+ Assert . Equal ( ( int ) UnsafeNclNativeMethods . ErrorCodes . ERROR_ALREADY_EXISTS , exception . ErrorCode ) ;
140
+ Assert . Contains ( $ "The prefix ' { address1 } ' is already registered. ", exception . Message ) ;
140
141
}
141
142
142
143
[ ConditionalFact ]
You can’t perform that action at this time.
0 commit comments