PageRenderTime 41ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): CC-BY-SA-3.0
  1. using Bifrost.Execution;
  2. using Bifrost.Validation;
  3. using Machine.Specifications;
  4. using Microsoft.Practices.ServiceLocation;
  5. using Moq;
  6. namespace Bifrost.Specs.Validation.for_ChapterValidatorProvider.given
  7. {
  8. public class a_chapter_validator_provider
  9. {
  10. protected static IChapterValidatorProvider chapter_validator_provider;
  11. protected static Mock<IServiceLocator> service_locator_mock;
  12. protected static Mock<ITypeDiscoverer> type_discoverer_mock;
  13. Establish context = () =>
  14. {
  15. service_locator_mock = new Mock<IServiceLocator>();
  16. type_discoverer_mock = new Mock<ITypeDiscoverer>();
  17. type_discoverer_mock.Setup(td => td.FindMultiple(typeof(IChapterValidator)))
  18. .Returns(new[]
  19. {
  20. typeof(Fakes.Sagas.TransitionalChapterValidator),
  21. typeof(Fakes.Sagas.NonTransitionalChapterValidator),
  22. typeof(NullChapterValidator)
  23. }
  24. );
  25. chapter_validator_provider = new ChapterValidatorProvider(type_discoverer_mock.Object, service_locator_mock.Object);
  26. };
  27. }
  28. }