LCOV - code coverage report
Current view: top level - Cqrs.Tests/Cache - When_saving_fails.cs Hit Total Coverage
Test: doc-coverage.info Lines: 0 3 0.0 %
Date: 2017-07-26

          Line data    Source code
       1             : using System;
       2             : using System.Runtime.Caching;
       3             : using Cqrs.Cache;
       4             : using Cqrs.Authentication;
       5             : using Cqrs.Tests.Substitutes;
       6             : using NUnit.Framework;
       7             : 
       8             : namespace Cqrs.Tests.Cache
       9             : {
      10             :         [TestFixture]
      11             :         public class When_saving_fails
      12           0 :         {
      13             :                 private CacheRepository<ISingleSignOnToken> _rep;
      14             :                 private TestAggregate _aggregate;
      15             :                 private TestRepository _testRep;
      16             : 
      17             :                 [SetUp]
      18           0 :                 public void Setup()
      19             :                 {
      20             :                         _testRep = new TestRepository();
      21             :                         _rep = new CacheRepository<ISingleSignOnToken>(_testRep, new TestInMemoryEventStore());
      22             :                         _aggregate = _testRep.Get<TestAggregate>(Guid.NewGuid());
      23             :                         _aggregate.DoSomething();
      24             :                         try
      25             :                         {
      26             :                                 _rep.Save(_aggregate, 100);
      27             :                         }
      28             :                         catch (Exception){}
      29             :                 }
      30             : 
      31             :                 [Test]
      32           0 :                 public void Should_evict_old_object_from_cache()
      33             :                 {
      34             :                         var aggregate = MemoryCache.Default.Get(_aggregate.Id.ToString());
      35             :                         Assert.That(aggregate, Is.Null);
      36             :                 }
      37             :         }
      38             : }

Generated by: LCOV version 1.10