public void WHEN_Pattern_Is_Null_SHOULD_Throw_ArgumentNullException()
        {
            // Arrange
            var assemblyHelper = new Composer.AssemblyHelper();

            // Act
            Action action = () => assemblyHelper.SafeLoadAssemblies(null);

            // Assert
            action.ShouldThrow <ArgumentNullException>();
        }
        public void WHEN_Everything_Is_Good_SHOULD_Load_Successfully()
        {
            // Arrange
            var assemblyHelper = new Composer.AssemblyHelper();

            // Act
            var assemblies = assemblyHelper.SafeLoadAssemblies();

            // Assert
            assemblies.Should().NotBeEmpty();
            assemblies.Should().Contain(GetType().Assembly);
        }
        public void WHEN_Pattern_Is_Valid_SHOULD_Load_Successfully()
        {
            // Arrange
            var assemblyHelper = new Composer.AssemblyHelper();

            // Act
            var assemblies = assemblyHelper.SafeLoadAssemblies("Orckestra.*Tests");

            // Assert
            assemblies.Should().NotBeEmpty();
            assemblies.Should().ContainItemsAssignableTo <Assembly>();
            assemblies.Should()
            .OnlyContain(
                a =>
                ((Assembly)a).ManifestModule.Name.StartsWith("Orckestra.") &&
                ((Assembly)a).ManifestModule.Name.EndsWith("Tests.dll"));
        }
        public void Setup()
        {
            _composerHost   = new Composer.ComposerHost();
            _assemblyHelper = new Composer.AssemblyHelper();
            var assemblies = new List <_Assembly>();

            // Load composer assemblies
            var loadedAssemblies = _assemblyHelper.SafeLoadAssemblies(ComposerDllRegex);

            assemblies.AddRange(loadedAssemblies);

            // Load other assemblies next to executing assembly
            assemblies.AddRange(_assemblyHelper.SafeLoadAssemblies());

            // Load specific assemblies
            assemblies.Add(Assembly.GetExecutingAssembly());

            // Add assemblies to dictionary
            foreach (var assembly in assemblies)
            {
                _appDomainAssemblies[assembly.FullName] = assembly;
            }
        }