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

          Line data    Source code
       1             : using System;
       2             : using System.Collections.Generic;
       3             : using System.Linq;
       4             : using Cqrs.Events;
       5             : using Cqrs.Authentication;
       6             : 
       7             : namespace Cqrs.Tests.Substitutes
       8             : {
       9             :         public class TestInMemoryEventStore : IEventStore<ISingleSignOnToken>
      10           0 :         {
      11             :                 public readonly List<IEvent<ISingleSignOnToken>> Events = new List<IEvent<ISingleSignOnToken>>();
      12             : 
      13           0 :                 public void Save<T>(IEvent<ISingleSignOnToken> @event)
      14             :                 {
      15             :                         Save(typeof(T), @event);
      16             :                 }
      17             : 
      18           0 :                 public void Save(Type aggregateRootType, IEvent<ISingleSignOnToken> @event)
      19             :                 {
      20             :                         lock(Events)
      21             :                         {
      22             :                                 Events.Add(@event);
      23             :                         }
      24             :                 }
      25             : 
      26           0 :                 public IEnumerable<IEvent<ISingleSignOnToken>> Get<T>(Guid aggregateId, bool useLastEventOnly = false, int fromVersion = -1)
      27             :                 {
      28             :                         return Get(typeof (T), aggregateId, useLastEventOnly, fromVersion);
      29             :                 }
      30             : 
      31           0 :                 public IEnumerable<IEvent<ISingleSignOnToken>> Get(Type aggregateType, Guid aggregateId, bool useLastEventOnly = false, int fromVersion = -1)
      32             :                 {
      33             :                         lock (Events)
      34             :                         {
      35             :                                 return Events.Where(x => x.Version > fromVersion && x.Id == aggregateId).OrderBy(x => x.Version).ToList();
      36             :                         }
      37             :                 }
      38             : 
      39           0 :                 public IEnumerable<EventData> Get(Guid correlationId)
      40             :                 {
      41             :                         return Enumerable.Empty<EventData>();
      42             :                 }
      43             :         }
      44             : }

Generated by: LCOV version 1.10