Skip to content

Commit 298bb22

Browse files
committed
Remove TestExtensions
1 parent 181bba1 commit 298bb22

File tree

3 files changed

+8
-36
lines changed

3 files changed

+8
-36
lines changed

src/NHibernate.Test/Async/SecondLevelCacheTest/InvalidationTests.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
using System.Collections;
1212
using System.Collections.Generic;
1313
using System.Linq;
14+
using System.Reflection;
1415
using NHibernate.Cache;
1516
using NHibernate.Cfg;
17+
using NHibernate.Engine;
1618
using NHibernate.Impl;
1719
using NHibernate.Test.SecondLevelCacheTests;
1820
using NSubstitute;
@@ -39,10 +41,11 @@ protected override void Configure(Configuration configuration)
3941
public async Task InvalidatesEntitiesAsync()
4042
{
4143
var debugSessionFactory = (DebugSessionFactory) Sfi;
42-
var sessionFactoryImpl = (SessionFactoryImpl) debugSessionFactory.ActualFactory;
4344

4445
var cache = Substitute.For<UpdateTimestampsCache>(Sfi.Settings, new Dictionary<string, string>());
45-
sessionFactoryImpl.SetPropertyUsingReflection(x => x.UpdateTimestampsCache, cache);
46+
47+
var updateTimestampsCacheField = typeof(SessionFactoryImpl).GetField("updateTimestampsCache");
48+
updateTimestampsCacheField.SetValue(debugSessionFactory.ActualFactory, cache);
4649

4750
//"Received" assertions can not be used since the collection is reused and cleared between calls.
4851
//The received args are cloned and stored

src/NHibernate.Test/SecondLevelCacheTest/InvalidationTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ protected override void Configure(Configuration configuration)
2727
public void InvalidatesEntities()
2828
{
2929
var debugSessionFactory = (DebugSessionFactory) Sfi;
30-
var sessionFactoryImpl = (SessionFactoryImpl) debugSessionFactory.ActualFactory;
3130

3231
var cache = Substitute.For<UpdateTimestampsCache>(Sfi.Settings, new Dictionary<string, string>());
33-
sessionFactoryImpl.SetPropertyUsingReflection(x => x.UpdateTimestampsCache, cache);
32+
33+
var updateTimestampsCacheField = typeof(SessionFactoryImpl).GetField("updateTimestampsCache");
34+
updateTimestampsCacheField.SetValue(debugSessionFactory.ActualFactory, cache);
3435

3536
//"Received" assertions can not be used since the collection is reused and cleared between calls.
3637
//The received args are cloned and stored

src/NHibernate.Test/TestExtensions.cs

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)