INNER CODE UNIT · C#
MongoDbSnapshotStoreTests
Chinchilla-Software-Com/CQRS · Framework/Cqrs.MongoDB.Tests.Integration/MongoDbSnapshotStoreTests.cs:37
public class MongoDbSnapshotStoreTests
{
/// <summary>
/// Tests the <see cref="ISnapshotStore.Save"/> method
/// Passing a valid test <see cref="IEvent{TAuthenticationToken}"/>
/// Expecting the test <see cref="IEvent{TAuthenticationToken}"/> is able to be read.
/// </summary>
[TestMethod]
public void Should_load_events()
{
// Arrange
TestMongoDbSnapshotStoreConnectionStringFactory.DatabaseName = string.Format("Test-{0}", new Random().Next(0, 9999));
NinjectDependencyResolver.ModulesToLoad.Add(new CqrsModule<int, DefaultAuthenticationTokenHelper>());
NinjectDependencyResolver.ModulesToLoad.Add(new InProcessEventBusModule<int>());
NinjectDependencyResolver.ModulesToLoad.Add(new TestMongoDbModule<int>());
NinjectDependencyResolver.Start();
var unitOfWork = new UnitOfWork<int>(DependencyResolver.Current.Resolve<ISnapshotAggregateRepository<int>>(), DependencyResolver.Current.Resolve<IAggregateRepository<int>>());
var aggregate = DependencyResolver.Current.Resolve<IAggregateFactory>().Create<TestAggregate>(Guid.NewGuid());