Skip to content

Commit 7c0e58d

Browse files
Add sample test config for Redis and SqlServer
1 parent f104104 commit 7c0e58d

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

CoreDistributedCache/NHibernate.Caches.CoreDistributedCache.Tests/App.config

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,30 @@
3333
<cache region="noExplicitExpiration" sliding="true" />
3434
</coredistributedcache> -->
3535

36+
<!-- For testing Redis
37+
<coredistributedcache factory-class="NHibernate.Caches.CoreDistributedCache.Redis.RedisFactory,NHibernate.Caches.CoreDistributedCache.Redis">
38+
<properties>
39+
<property name="configuration">localhost</property>
40+
<property name="instance-name">test</property>
41+
</properties>
42+
<cache region="foo" expiration="500" sliding="true" />
43+
<cache region="noExplicitExpiration" sliding="true" />
44+
</coredistributedcache> -->
45+
46+
<!-- For testing SqlServer
47+
These settings suppose the following commands have been run from the test project directory:
48+
dotnet restore
49+
dotnet sql-cache create "Server=.\SQLExpress;initial catalog=nhibernate;Integrated Security=SSPI" dbo sqlServerDistributedCache
50+
<coredistributedcache factory-class="NHibernate.Caches.CoreDistributedCache.SqlServer.SqlServerFactory,NHibernate.Caches.CoreDistributedCache.SqlServer">
51+
<properties>
52+
<property name="connection-string">Server=.\SQLExpress;initial catalog=nhibernate;Integrated Security=SSPI</property>
53+
<property name="schema-name">dbo</property>
54+
<property name="table-name">sqlServerDistributedCache</property>
55+
</properties>
56+
<cache region="foo" expiration="500" sliding="true" />
57+
<cache region="noExplicitExpiration" sliding="true" />
58+
</coredistributedcache> -->
59+
3660
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
3761
<session-factory>
3862
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>

CoreDistributedCache/NHibernate.Caches.CoreDistributedCache.Tests/NHibernate.Caches.CoreDistributedCache.Tests.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,7 @@
3030
<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp2.0'">
3131
<PackageReference Include="NUnitLite" Version="3.9.0" />
3232
</ItemGroup>
33-
</Project>
33+
<ItemGroup>
34+
<DotNetCliToolReference Include="Microsoft.Extensions.Caching.SqlConfig.Tools" Version="2.0.0" />
35+
</ItemGroup>
36+
</Project>

0 commit comments

Comments
 (0)