IFluentSolutionConfiguration IFluentSolutionConfiguration.ConfigureProject(string projectName, Action <IFluentProjectConfiguration> action)
        {
            if (projectName == null)
            {
                throw new ArgumentNullException(nameof(projectName));
            }
            if (action == null)
            {
                throw new ArgumentNullException(nameof(action));
            }
            var projectConfig = new ProjectConfiguration(this, projectName);

            ProjectConfigurations.Add(projectConfig);
            action(projectConfig);
            return(this);
        }
Exemplo n.º 2
0
        public AsyncCodeConfiguration ConfigureProject(string projectFilePath, Action <IFluentProjectConfiguration> action)
        {
            if (projectFilePath == null)
            {
                throw new ArgumentNullException(nameof(projectFilePath));
            }
            if (action == null)
            {
                throw new ArgumentNullException(nameof(action));
            }
            if (!File.Exists(projectFilePath))
            {
                throw new FileNotFoundException($"Project not found. Path:'{projectFilePath}'");
            }
            var solutionConfig = ProjectConfigurations.FirstOrDefault(o => o.Path == projectFilePath);

            if (solutionConfig == null)
            {
                solutionConfig = new ProjectConfiguration(projectFilePath);
                ProjectConfigurations.Add(solutionConfig);
            }
            action(solutionConfig);
            return(this);
        }