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

/Source/Bifrost.Specs/Events/for_EventConverter/given/an_event_converter.cs

#
C# | 27 lines | 23 code | 4 blank | 0 comment | 0 complexity | b2906309a61d185426c374a87fa62a6c MD5 | raw file
 1using Bifrost.Events;
 2using Machine.Specifications;
 3using Moq;
 4using Bifrost.Serialization;
 5using System;
 6
 7namespace Bifrost.Specs.Events.for_EventConverter.given
 8{
 9    public class an_event_converter
10    {
11        protected static Mock<ISerializer>  serializer_mock;
12        protected static Mock<IEventMigratorManager> event_migrator_manager_mock;
13        protected static Mock<IEventMigrationHierarchyManager> event_migration_hierarchy_manager;
14        protected static EventConverter converter;
15
16        Establish context = () =>
17        {
18            serializer_mock = new Mock<ISerializer>();
19            event_migrator_manager_mock = new Mock<IEventMigratorManager>();
20            event_migration_hierarchy_manager = new Mock<IEventMigrationHierarchyManager>();
21
22            event_migration_hierarchy_manager.Setup(e => e.GetLogicalTypeForEvent(Moq.It.IsAny<Type>())).Returns((Type t) => t);
23
24            converter = new EventConverter(serializer_mock.Object, event_migrator_manager_mock.Object, event_migration_hierarchy_manager.Object);
25        };
26    }
27}