Skip to content

Commit

Permalink
Make Pickles UI generate each selected output format once instead of …
Browse files Browse the repository at this point in the history
…the first selected output format multiple times
  • Loading branch information
Dirk Rombauts committed Oct 16, 2013
1 parent 509c40b commit b5aa957
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/Pickles/Pickles.UserInterface/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,25 +505,25 @@ private void DoGenerate()

private void DoWork()
{
var builder = new ContainerBuilder();
builder.RegisterAssemblyTypes(typeof(Runner).Assembly);
builder.Register<FileSystem>(_ => new FileSystem()).As<IFileSystem>().SingleInstance();
builder.RegisterModule<PicklesModule>();
var container = builder.Build();

var configuration = container.Resolve<Configuration>();
var fileSystem = container.Resolve<IFileSystem>();

configuration.FeatureFolder = fileSystem.DirectoryInfo.FromDirectoryName(this.featureFolder);
configuration.OutputFolder = fileSystem.DirectoryInfo.FromDirectoryName(this.outputFolder);
configuration.SystemUnderTestName = this.projectName;
configuration.SystemUnderTestVersion = this.projectVersion;
configuration.TestResultsFile = this.IncludeTests ? fileSystem.FileInfo.FromFileName(this.testResultsFile) : null;
configuration.TestResultsFormat = this.testResultsFormats.Selected;
configuration.Language = this.selectedLanguage != null ? this.selectedLanguage.TwoLetterISOLanguageName : CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;

foreach (DocumentationFormat documentationFormat in this.documentationFormats.Selected)
{
var builder = new ContainerBuilder();
builder.RegisterAssemblyTypes(typeof(Runner).Assembly);
builder.Register<FileSystem>(_ => new FileSystem()).As<IFileSystem>().SingleInstance();
builder.RegisterModule<PicklesModule>();
var container = builder.Build();

var configuration = container.Resolve<Configuration>();
var fileSystem = container.Resolve<IFileSystem>();

configuration.FeatureFolder = fileSystem.DirectoryInfo.FromDirectoryName(this.featureFolder);
configuration.OutputFolder = fileSystem.DirectoryInfo.FromDirectoryName(this.outputFolder);
configuration.SystemUnderTestName = this.projectName;
configuration.SystemUnderTestVersion = this.projectVersion;
configuration.TestResultsFile = this.IncludeTests ? fileSystem.FileInfo.FromFileName(this.testResultsFile) : null;
configuration.TestResultsFormat = this.testResultsFormats.Selected;
configuration.Language = this.selectedLanguage != null ? this.selectedLanguage.TwoLetterISOLanguageName : CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;

configuration.DocumentationFormat = documentationFormat;
var runner = container.Resolve<Runner>();
runner.Run(container);
Expand Down

0 comments on commit b5aa957

Please sign in to comment.