Permalink
Browse files

Upgraded to StructureMap 2.6.1 and included Samples.Tests in the Exce…

…lMapper Build
  • Loading branch information...
1 parent d2c1ffa commit 145a6d0e63252e235ff626c55bdd6cd3ceb0ebfb @shashankshetty shashankshetty committed Feb 21, 2010
View
@@ -57,7 +57,7 @@
</copy>
</target>
- <target name="test" depends="ExcelMapperTests, BuildDTOsFromExcel" />
+ <target name="test" depends="ExcelMapperTests, BuildDTOsFromExcelTests, SamplesTests" />
<target name="build" depends="compile, test, updateSampleExcel" description="Clean, Compile, run tests" />
@@ -76,14 +76,22 @@
</exec>
</target>
- <target name="BuildDTOsFromExcel">
+ <target name="BuildDTOsFromExcelTests">
<exec program="${nunit-console.exe}" workingdir="${build.dir}">
<arg value="BuildDTOsFromExcel.Tests.dll" />
<arg value="/xml:BuildDTOsFromExcelTests.xml" />
<arg value="/nologo" />
</exec>
</target>
+ <target name="SamplesTests">
+ <exec program="${nunit-console.exe}" workingdir="${build.dir}">
+ <arg value="Samples.Tests.dll" />
+ <arg value="/xml:SamplesTests.xml" />
+ <arg value="/nologo" />
+ </exec>
+ </target>
+
<target name="updateSampleExcel" description="Update lib folder">
<exec program="${build.dir}\${BuildDTOsFromExcel.exe}" workingdir="${build.dir}">
<arg value="..\${Excel.dir}\*.xls" />
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
@@ -8,13 +8,13 @@ public class ExcelMapperRegistry : Registry
{
public ExcelMapperRegistry()
{
- ForRequestedType<IDataProvider>()
- .TheDefaultIsConcreteType<OleDbDataProvider>();
- ForRequestedType<IRepository>()
- .TheDefaultIsConcreteType<ExcelRepository>();
- ForRequestedType<IFileConfiguration>()
- .AsSingletons()
- .TheDefaultIsConcreteType<FileConfiguration>();
+ For<IDataProvider>()
+ .Use<OleDbDataProvider>();
+ For<IRepository>()
+ .Use<ExcelRepository>();
+ For<IFileConfiguration>()
+ .Singleton()
+ .Use<FileConfiguration>();
Scan(s =>
{
s.AssemblyContainingType<ExcelMapperRegistry>();
@@ -55,7 +55,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\RunTimeCodeGenerator\RunTimeCodeGenerator.dll</HintPath>
</Reference>
- <Reference Include="StructureMap, Version=2.5.4.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
+ <Reference Include="StructureMap, Version=2.6.1.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\StructureMap\StructureMap.dll</HintPath>
</Reference>
@@ -39,7 +39,7 @@ public void ReadFromExcel()
ServiceLocator.Current.GetInstance<IFileConfiguration>().FileName = UserFile;
foreach (User user in _repository.Get<User>("User"))
{
- Console.WriteLine("Hello {0} {1}", user.FirstName, user.LastName);
+ Console.WriteLine("{0} {1}", user.FirstName, user.LastName);
}
}

0 comments on commit 145a6d0

Please sign in to comment.