Skip to content

Commit 96f0fcc

Browse files
committed
[FIX] Code Style Testing library
1 parent bbbc8db commit 96f0fcc

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

src/EmbedIO.Testing/Internal/TestRequest.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,7 @@ public TestRequest(HttpRequestMessage clientRequest)
3838
break;
3939
}
4040

41-
switch (pair.Key)
42-
{
43-
case HttpHeaderNames.Cookie:
44-
Cookies = CookieList.Parse(string.Join(",", values));
45-
break;
46-
}
41+
if (pair.Key == HttpHeaderNames.Cookie) Cookies = CookieList.Parse(string.Join(",", values));
4742
}
4843

4944
Headers = headers;
@@ -53,7 +48,7 @@ public TestRequest(HttpRequestMessage clientRequest)
5348
ProtocolVersion = clientRequest.Version;
5449
KeepAlive = !(clientRequest.Headers.ConnectionClose ?? true);
5550
RawUrl = clientRequest.RequestUri.PathAndQuery;
56-
QueryString = UrlEncodedDataParser.Parse(clientRequest.RequestUri.Query, true, true);
51+
QueryString = UrlEncodedDataParser.Parse(clientRequest.RequestUri.Query, true);
5752
HttpMethod = clientRequest.Method.ToString();
5853
HttpVerb = HttpMethodToVerb(clientRequest.Method);
5954
Url = clientRequest.RequestUri;

src/EmbedIO.Testing/MockFileProvider.MockDirectoryEntry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ protected MockDirectoryEntry()
1313

1414
public DateTime LastModifiedUtc { get; private set; }
1515

16-
public void Touch() => LastModifiedUtc = DateTime.UtcNow;
16+
protected void Touch() => LastModifiedUtc = DateTime.UtcNow;
1717
}
1818
}
1919
}

src/EmbedIO/IHttpRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public interface IHttpRequest : IHttpMessage
9595
/// <summary>
9696
/// Gets the type of the content.
9797
/// </summary>
98-
string ContentType { get; }
98+
string? ContentType { get; }
9999

100100
/// <summary>
101101
/// Gets the content length.
@@ -110,6 +110,6 @@ public interface IHttpRequest : IHttpMessage
110110
/// <summary>
111111
/// Gets the URL referrer.
112112
/// </summary>
113-
Uri UrlReferrer { get; }
113+
Uri? UrlReferrer { get; }
114114
}
115115
}

0 commit comments

Comments
 (0)