@@ -11,7 +11,7 @@ public class SSLLService
11
11
{
12
12
#region construction
13
13
14
- private readonly IApiProvider _api ;
14
+ private readonly IApiProvider _apiProvider ;
15
15
private readonly RequestModelFactory _requestModelFactory ;
16
16
private readonly ResponsePopulation _responsePopulation ;
17
17
private readonly UrlValidation _urlValidation ;
@@ -43,15 +43,18 @@ public enum All
43
43
Done
44
44
}
45
45
46
- public SSLLService ( string apiUrl )
47
- {
48
- _api = new SSLLabsApi ( ) ;
46
+ public SSLLService ( string apiUrl ) : this ( apiUrl , new SSLLabsApi ( ) )
47
+ {
48
+ }
49
+
50
+ internal SSLLService ( string apiUrl , IApiProvider apiProvider )
51
+ {
52
+ _apiProvider = apiProvider ;
49
53
_requestModelFactory = new RequestModelFactory ( ) ;
50
54
_urlValidation = new UrlValidation ( ) ;
51
55
_responsePopulation = new ResponsePopulation ( ) ;
52
-
53
56
ApiUrl = apiUrl ;
54
- }
57
+ }
55
58
56
59
#endregion
57
60
@@ -65,7 +68,7 @@ public Info Info()
65
68
try
66
69
{
67
70
// Making Api request and gathering response
68
- var webResponse = _api . MakeGetRequest ( requestModel ) ;
71
+ var webResponse = _apiProvider . MakeGetRequest ( requestModel ) ;
69
72
70
73
// Binding result to model
71
74
infoModel = _responsePopulation . InfoModel ( webResponse , infoModel ) ;
@@ -112,7 +115,7 @@ public Analyze Analyze(string host, Publish publish, ClearCache clearCache, From
112
115
try
113
116
{
114
117
// Making Api request and gathering response
115
- var webResponse = _api . MakeGetRequest ( requestModel ) ;
118
+ var webResponse = _apiProvider . MakeGetRequest ( requestModel ) ;
116
119
117
120
// Binding result to model
118
121
analyzeModel = _responsePopulation . AnalyzeModel ( webResponse , analyzeModel ) ;
@@ -153,7 +156,7 @@ public Endpoint GetEndpointData(string host, string s, FromCache fromCache)
153
156
try
154
157
{
155
158
// Making Api request and gathering response
156
- var webResponse = _api . MakeGetRequest ( requestModel ) ;
159
+ var webResponse = _apiProvider . MakeGetRequest ( requestModel ) ;
157
160
158
161
// Binding result to model
159
162
endpointModel = _responsePopulation . EndpointModel ( webResponse , endpointModel ) ;
@@ -180,7 +183,7 @@ public StatusDetails GetStatusCodes()
180
183
try
181
184
{
182
185
// Making Api request and gathering response
183
- var webResponse = _api . MakeGetRequest ( requestModel ) ;
186
+ var webResponse = _apiProvider . MakeGetRequest ( requestModel ) ;
184
187
185
188
// Binding result to model
186
189
statusDetailsModel = _responsePopulation . StatusDetailsModel ( webResponse , statusDetailsModel ) ;
0 commit comments