protected static void CreateInvalidTaskCataloger()
 {
     loggerMock = new Mock<ILog>();
     TaskCatalogLoader = new DirectoryTaskCatalogLoader(nonexistingDirectoryPath,loggerMock.Object);
 }
 public void should_use_the_given_logger()
 {
     loggerMock = new Mock<ILog>();
     DirectoryTaskCatalogLoader catalogLoader = new DirectoryTaskCatalogLoader(existingDirectoryPath, loggerMock.Object);
     IEnumerable<Type> tasks = catalogLoader.GetCatalog();
     loggerMock.Verify(l=>l.WriteEntry(It.IsAny<InfoLogEntry>()), Times.AtLeastOnce());
 }
        public void should_ignore_invalid_dll_files()
        {
            
            Scenario.StartNew(this, scenario =>
                {
                    IEnumerable<Type> tasks = null;

                    scenario.Given("an invalid dll exists in the directory", ()=>
                    {
                        loggerMock = new Mock<ILog>();
                        TaskCatalogLoader = new DirectoryTaskCatalogLoader(Path.Combine(Environment.CurrentDirectory,"Testdata"), loggerMock.Object);
                    });
                    scenario.When("task catalog has been created", ()=>
                    {
                        tasks = TaskCatalogLoader.GetCatalog();
                    });
                    scenario.Then("assure the faulty dll load was logged as a warning", () =>
                    {
                        loggerMock.Verify(l=>l.WriteEntry(It.IsAny<WarningLogEntry>()), Times.Once());
                    });
                });
        }
 public void should_return_a_list_of_tasks()
 {
     loggerMock = new Mock<ILog>();
     DirectoryTaskCatalogLoader catalogLoader = new DirectoryTaskCatalogLoader(existingDirectoryPath, loggerMock.Object);
     IEnumerable<Type> tasks = catalogLoader.GetCatalog();
     tasks.ShouldNotBeNull();
 }