Skip to content

Commit 36e6393

Browse files
committed
more tests
1 parent 7db496c commit 36e6393

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

src/DeltaTests/MiddlewareTests.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,30 @@ await Verify(
9090
})
9191
.AddScrubber(_ => _.Replace(DeltaExtensions.AssemblyWriteTime, "AssemblyWriteTime"));
9292
}
93+
94+
[Test]
95+
public void CacheControlExtensions()
96+
{
97+
var context = new DefaultHttpContext();
98+
var response = context.Response;
99+
100+
response.NoStore();
101+
AreEqual("no-store, max-age=0", response.Headers.CacheControl.ToString());
102+
103+
response.NoCache();
104+
AreEqual("no-cache", response.Headers.CacheControl.ToString());
105+
106+
response.CacheForever();
107+
AreEqual("public, max-age=31536000, immutable", response.Headers.CacheControl.ToString());
108+
}
109+
110+
[Test]
111+
public void ConnectionImplicitOperator()
112+
{
113+
using var dbConnection = new Microsoft.Data.SqlClient.SqlConnection();
114+
Delta.Connection connection = dbConnection;
115+
116+
AreEqual(dbConnection, connection.SqlConnection);
117+
IsNull(connection.DbTransaction);
118+
}
93119
}

src/coverage.runsettings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Configuration>
77
<Format>cobertura,opencover</Format>
88
<Exclude>[*.Tests]*,[*.Test]*</Exclude>
9-
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExludeByAttribute>
9+
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>
1010
<IncludeTestAssembly>false</IncludeTestAssembly>
1111
<SkipAutoProps>true</SkipAutoProps>
1212
</Configuration>

0 commit comments

Comments
 (0)