Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added tests for a caching disabler

  • Loading branch information...
commit 587664c6f7d621495f5197e6b632403ec1e13ab1 1 parent 5efcdf6
@gravypower gravypower authored
View
37 Tests/Unit Tests/Glass.Mapper.Tests/Caching/CacheDisablerFixture.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Glass.Mapper.Caching;
+using Glass.Mapper.Pipelines.ObjectConstruction;
+using NSubstitute;
+using NUnit.Framework;
+
+namespace Glass.Mapper.Tests.Caching
+{
+ [TestFixture]
+ public class CacheDisablerFixture
+ {
+ [Test]
+ public void CanDisableCache_For_ObjectConstructionArgs()
+ {
+ var args = Substitute.For<ObjectConstructionArgs>();
+
+ using (new CacheDisabler(args))
+ {
+ Assert.IsTrue(args.DisableCache);
+ }
+ }
+
+ [Test]
+ public void CanDisableCache_For_IAbstractService()
+ {
+ var abstractService = Substitute.For<IAbstractService>();
+
+ using (new CacheDisabler(abstractService))
+ {
+ Assert.IsTrue(abstractService.DisableCache);
+ }
+ }
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.