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 TestEventStoreWithBugs : IEventStore<ISingleSignOnToken>
10 0 : {
11 0 : public void Save(Type aggregateRootType, IEvent<ISingleSignOnToken> @event)
12 : {
13 : }
14 :
15 0 : public IEnumerable<IEvent<ISingleSignOnToken>> Get<T>(Guid aggregateId, bool useLastEventOnly = false, int fromVersion = -1)
16 : {
17 : return Get(typeof (T), aggregateId, useLastEventOnly, fromVersion);
18 : }
19 :
20 0 : public IEnumerable<IEvent<ISingleSignOnToken>> Get(Type aggregateType, Guid aggregateId, bool useLastEventOnly = false, int fromVersion = -1)
21 : {
22 : if (aggregateId == Guid.Empty)
23 : {
24 : return new List<IEvent<ISingleSignOnToken>>();
25 : }
26 :
27 : return new List<IEvent<ISingleSignOnToken>>
28 : {
29 : new TestAggregateDidSomething {Id = aggregateId, Version = 3},
30 : new TestAggregateDidSomething {Id = aggregateId, Version = 4},
31 : new TestAggregateDidSomethingElse {Id = aggregateId, Version = 2}
32 : }
33 : .Where(x => x.Version > fromVersion);
34 : }
35 :
36 0 : public IEnumerable<EventData> Get(Guid correlationId)
37 : {
38 : return Enumerable.Empty<EventData>();
39 : }
40 :
41 0 : public void Save<T>(IEvent<ISingleSignOnToken> eventDescriptor)
42 : {
43 : }
44 : }
45 : }
|