PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 1ms

/Source/Bifrost.Specs/Validation/for_ChapterValidatorProvider/given/a_chapter_validator_provider.cs

#
C# | 33 lines | 28 code | 5 blank | 0 comment | 0 complexity | 16b3109017dd8c5114d6914749f3e3c8 MD5 | raw file
 1using Bifrost.Execution;
 2using Bifrost.Validation;
 3using Machine.Specifications;
 4using Microsoft.Practices.ServiceLocation;
 5using Moq;
 6
 7namespace Bifrost.Specs.Validation.for_ChapterValidatorProvider.given
 8{
 9    public class a_chapter_validator_provider
10    {
11        protected static IChapterValidatorProvider chapter_validator_provider;
12
13        protected static Mock<IServiceLocator> service_locator_mock;
14        protected static Mock<ITypeDiscoverer> type_discoverer_mock;
15
16        Establish context = () =>
17                                {
18                                    service_locator_mock = new Mock<IServiceLocator>();
19                                    type_discoverer_mock = new Mock<ITypeDiscoverer>();
20
21                                    type_discoverer_mock.Setup(td => td.FindMultiple(typeof(IChapterValidator)))
22                                        .Returns(new[]
23                                                {
24                                                    typeof(Fakes.Sagas.TransitionalChapterValidator),
25                                                    typeof(Fakes.Sagas.NonTransitionalChapterValidator),
26                                                    typeof(NullChapterValidator)
27                                                }
28                                        );
29
30                                    chapter_validator_provider = new ChapterValidatorProvider(type_discoverer_mock.Object, service_locator_mock.Object);
31                                };
32    }
33}