Line data Source code
1 : #region Copyright
2 : // // -----------------------------------------------------------------------
3 : // // <copyright company="Chinchilla Software Limited">
4 : // // Copyright Chinchilla Software Limited. All rights reserved.
5 : // // </copyright>
6 : // // -----------------------------------------------------------------------
7 : #endregion
8 :
9 : using System;
10 : using Cqrs.Azure.DocumentDb.Events;
11 : using Cqrs.Events;
12 : using Cqrs.Ninject.Azure.DocumentDb.Events;
13 : using Cqrs.Snapshots;
14 : using Ninject.Modules;
15 :
16 : namespace Cqrs.Ninject.Azure.DocumentDb.Configuration
17 : {
18 : /// <summary>
19 : /// A <see cref="INinjectModule"/> that wires up <see cref="AzureDocumentDbEventStoreConnectionStringFactory"/> as the
20 : /// <see cref="IAzureDocumentDbEventStoreConnectionStringFactory"/>.
21 : /// </summary>
22 : /// <typeparam name="TAuthenticationToken">The <see cref="Type"/> of the authentication token.</typeparam>
23 : public class TestAzureDocumentDbEventStoreModule<TAuthenticationToken>
24 : : AzureDocumentDbEventStoreModule<TAuthenticationToken>
25 1 : {
26 : /// <summary>
27 : /// Register the <see cref="IAzureDocumentDbEventStoreConnectionStringFactory"/> and <see cref="IEventStore{TAuthenticationToken}"/>
28 : /// </summary>
29 1 : public override void RegisterEventStore()
30 : {
31 : Bind<IAzureDocumentDbEventStoreConnectionStringFactory>()
32 : .To<TestAzureDocumentDbEventStoreConnectionStringFactory>()
33 : .InSingletonScope();
34 : Bind<IAzureDocumentDbSnapshotStoreConnectionStringFactory>()
35 : .To<TestAzureDocumentDbEventStoreConnectionStringFactory>()
36 : .InSingletonScope();
37 :
38 : Bind<IEventStore<TAuthenticationToken>>()
39 : .To<AzureDocumentDbEventStore<TAuthenticationToken>>()
40 : .InSingletonScope();
41 : Bind<ISnapshotStore>()
42 : .To<AzureDocumentDbSnapshotStore>()
43 : .InSingletonScope();
44 : }
45 : }
46 : }
|