Permalink
Browse files

Renamed Log4net.xml to RunTimCodeGeneratorLogging.xml

  • Loading branch information...
1 parent 332072b commit 0cdb7cd61af932aacb8384b362fabd4d8e54b2e8 @shashankshetty shashankshetty committed Jul 7, 2009
@@ -83,6 +83,9 @@
</Content>
</ItemGroup>
<ItemGroup>
+ <None Include="TestDirectory\Roles.xlsx">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
<None Include="TestDirectory\Users.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@@ -1,3 +1,7 @@
+using System;
+using System.IO;
+using System.Reflection;
+
using BuildDTOsFromExcel.FileService;
using ExcelMapper;
@@ -26,12 +30,22 @@ public void SetUp()
[Test]
public void Should_create_class_files_for_each_tab_and_write_a_success_message_if_excelmapper_run_is_success()
{
- string[] args = new[] { "TestDirectory\\Users.xlsx" };
+ string[] args = new[] { "TestDirectory\\Users.xlsx", "TestDirectory\\Roles.xlsx" };
Assert.AreEqual(DefaultSettings.SuccessMessage, _engine.Run(args));
}
[Test]
+ public void Should_create_classes_for_each_of_the_tabs_in_the_assembly()
+ {
+ Assembly assembly = Assembly.LoadFile(Path.GetFullPath("ExcelToDTOMapper.DTO.dll"));
+ Type[] types = assembly.GetTypes();
+ Assert.IsTrue(types.Length == 2);
+ Assert.AreEqual("User", types[0].Name);
+ Assert.AreEqual("Role", types[1].Name);
+ }
+
+ [Test]
public void Should_write_an_error_message_if_the_excelmapper_fails()
{
string[] args = new[] { "TestDirectory\\User.xlsx" };
Binary file not shown.
@@ -15,7 +15,7 @@ public class AssemblyGenerator : IAssemblyGenerator
public AssemblyGenerator()
{
- XmlConfigurator.Configure(new FileInfo("log4net.xml"));
+ XmlConfigurator.Configure(new FileInfo(DefaultSettings.LogFile));
}
public bool Compile(string[] classNames, AssemblyAttributes assemblyAttributes)
@@ -0,0 +1,8 @@
+namespace RunTimeCodeGenerator
+{
+ public class DefaultSettings
+ {
+ public static string LogFile = "RunTimCodeGeneratorLogging.xml";
+
+ }
+}
@@ -68,11 +68,12 @@
<Compile Include="ClassGeneration\IClassGenerator.cs" />
<Compile Include="ClassGeneration\Method.cs" />
<Compile Include="ClassGeneration\Property.cs" />
+ <Compile Include="DefaultSettings.cs" />
<Compile Include="RunTimeCodeGeneratorRegistry.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
- <Content Include="log4net.xml">
+ <Content Include="RunTimCodeGeneratorLogging.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

0 comments on commit 0cdb7cd

Please sign in to comment.