PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Source/Bifrost.Specs/Events/for_EventMigrationManager/given/a_first_generation_event.cs

#
C# | 31 lines | 28 code | 3 blank | 0 comment | 0 complexity | 622f233ffbbe502f6f253d8121979631 MD5 | raw file
 1using System;
 2using Bifrost.Events;
 3using Bifrost.Execution;
 4using Bifrost.Fakes.Events;
 5using Machine.Specifications;
 6using Microsoft.Practices.ServiceLocation;
 7using Moq;
 8
 9namespace Bifrost.Specs.Events.for_EventMigrationManager.given
10{
11    public abstract class an_event_migrator_service_with_no_registered_migrators
12    {
13        protected static SimpleEvent source_event;
14        protected static Guid event_source_id;
15        protected static Mock<ITypeDiscoverer> type_discoverer_mock;
16        protected static Mock<IServiceLocator> service_locator_mock;
17        protected static EventMigratorManager event_migrator_manager;
18
19        protected Establish context = () =>
20                                {
21                                    event_source_id = Guid.NewGuid();
22                                    source_event = new SimpleEvent(event_source_id);
23                                    type_discoverer_mock = new Mock<ITypeDiscoverer>();
24                                    service_locator_mock = new Mock<IServiceLocator>();
25                                    service_locator_mock.Setup(s => s.GetInstance(Moq.It.IsAny<Type>())).Returns(
26                                        (Type t) => Activator.CreateInstance(t));
27
28                                    event_migrator_manager = new EventMigratorManager(type_discoverer_mock.Object, service_locator_mock.Object);
29                                };
30    }
31}