Skip to content

Commit

Permalink
change external step binding assembly configuration to use the assemb…
Browse files Browse the repository at this point in the history
…ly name instead of the file
  • Loading branch information
gasparnagy committed Apr 29, 2010
1 parent 5917ed0 commit 88e2635
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Runtime/Configuration/ConfigurationSectionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,17 @@ protected override ConfigurationElement CreateNewElement()

protected override object GetElementKey(ConfigurationElement element)
{
return ((StepAssemblyConfigElement)element).File;
return ((StepAssemblyConfigElement)element).Assembly;
}
}

public class StepAssemblyConfigElement : ConfigurationElement
{
[ConfigurationProperty("file", DefaultValue = null, IsRequired = false)]
public string File
[ConfigurationProperty("assembly", DefaultValue = null, IsRequired = false)]
public string Assembly
{
get { return (string)this["file"]; }
set { this["file"] = value; }
get { return (string)this["assembly"]; }
set { this["assembly"] = value; }
}
}
}
7 changes: 4 additions & 3 deletions Runtime/Configuration/RuntimeConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ public static RuntimeConfiguration LoadFromConfigFile(ConfigurationSectionHandle

foreach (var element in configSection.StepAssemblies)
{
string stepAssemblyFileName = ((StepAssemblyConfigElement)element).File;
string fullPath = Path.GetFullPath(stepAssemblyFileName);
Assembly stepAssembly = Assembly.LoadFile(fullPath);
// string stepAssemblyFileName = ((StepAssemblyConfigElement)element).File;
// string fullPath = Path.GetFullPath(stepAssemblyFileName);
// Assembly stepAssembly = Assembly.LoadFile(fullPath);
Assembly stepAssembly = Assembly.Load(((StepAssemblyConfigElement)element).Assembly);
config._additionalStepAssemblies.Add(stepAssembly);
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/FeatureTests/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
/>

<stepAssemblies>
<stepAssembly file="..\..\ExternalSteps\ExternalStepsVB\bin\debug\ExternalStepsVB.dll" />
<stepAssembly file="..\..\ExternalSteps\ExternalStepsCS\bin\debug\ExternalStepsCS.dll" />
<stepAssembly assembly="ExternalStepsVB" />
<stepAssembly assembly="ExternalStepsCS" />
</stepAssemblies>

</specFlow>
Expand Down
8 changes: 8 additions & 0 deletions Tests/FeatureTests/FeatureTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@
<Name>TechTalk.SpecFlow</Name>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="ExternalSteps\ExternalStepsCS\ExternalStepsCS.csproj">
<Project>{3836A6FC-4ECC-413A-AC8F-83A0A773EC9E}</Project>
<Name>ExternalStepsCS</Name>
</ProjectReference>
<ProjectReference Include="ExternalSteps\ExternalStepsVB\ExternalStepsVB.vbproj">
<Project>{D3F6B835-B228-4DCF-B533-B6ED469A33B3}</Project>
<Name>ExternalStepsVB</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Expand Down

0 comments on commit 88e2635

Please sign in to comment.