Skip to content

Commit

Permalink
Removed some unneeded classes and internalised some of our plumbing c…
Browse files Browse the repository at this point in the history
…lasses.
  • Loading branch information
jagregory committed Aug 25, 2009
1 parent a82e2d2 commit 1e70497
Show file tree
Hide file tree
Showing 20 changed files with 52 additions and 530 deletions.
Expand Up @@ -3,7 +3,7 @@
using System.Xml;
using FluentNHibernate.Conventions;
using FluentNHibernate.Mapping;
using FluentNHibernate.Xml;
using FluentNHibernate.MappingModel.Output;
using NHibernate.Cfg;
using NUnit.Framework;

Expand All @@ -13,7 +13,6 @@ public class MappingTester<T>
{
protected XmlElement currentElement;
protected XmlDocument document;
protected IMappingVisitor _visitor;
private readonly PersistenceModel model;
private string currentPath;

Expand All @@ -24,7 +23,6 @@ public MappingTester()
public MappingTester(PersistenceModel model)
{
this.model = model;
_visitor = new MappingVisitor(new Configuration());
}

public virtual MappingTester<T> RootElement
Expand Down
10 changes: 6 additions & 4 deletions src/FluentNHibernate.Testing/FluentNHibernate.Testing.csproj
Expand Up @@ -12,6 +12,8 @@
<AssemblyName>FluentNHibernate.Testing</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\FluentKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -361,10 +363,8 @@
<Compile Include="Utils\ReflectionHelperTests.cs" />
<Compile Include="Testing\XmlWriterTestHelper.cs" />
<Compile Include="Utils\TypeReferenceEqualityTests.cs" />
<Compile Include="Xml\MappingXmlTestHelper.cs" />
<Compile Include="Xml\MappingXmlValidatorTester.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Xml\MappingXmlSerializerTester.cs" />
<Compile Include="Xml\MappingXmlTestHelper.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FluentNHibernate\FluentNHibernate.csproj">
Expand All @@ -374,11 +374,13 @@
</ItemGroup>
<ItemGroup>
<Content Include="Cfg\hibernate.cfg.xml" />
<Content Include="DeclarativeTesting.htm" />
<EmbeddedResource Include="Fixtures\HbmOne.hbm.xml" />
<EmbeddedResource Include="Fixtures\HbmTwo.hbm.xml" />
</ItemGroup>
<ItemGroup>
<None Include="..\FluentKey.snk">
<Link>FluentKey.snk</Link>
</None>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
Expand Down
@@ -1,10 +1,7 @@
using System;
using System.Xml;
using FluentNHibernate.MappingModel;
using FluentNHibernate.Xml;
using NUnit.Framework;
using FluentNHibernate.MappingModel.Output;
using FluentNHibernate.Testing.Xml;
using FluentNHibernate.MappingModel.Output;

namespace FluentNHibernate.Testing.MappingModel
{
Expand All @@ -16,29 +13,6 @@ public static MappingXmlTestHelper VerifyXml<T>(this IXmlWriter<T> writer, T mod

return new MappingXmlTestHelper(document);
}

public static void ShouldGenerateValidOutput<T>(this IXmlWriter<T> writer, T model)
{
var document = writer.Write(model);
ShouldBeValidXml(document);
}

public static void ShouldBeValidAgainstSchema(this HibernateMapping mapping)
{
var serializer = new MappingXmlSerializer();
XmlDocument document = serializer.Serialize(mapping);
ShouldBeValidXml(document);
}

public static void ShouldBeValidXml(this XmlDocument document)
{
MappingXmlValidator validator = new MappingXmlValidator();
var result = validator.Validate(document);

document.OutputXmlToConsole();
Assert.IsTrue(result.Success, result.FullMessageLog);
}


public static void OutputXmlToConsole(this XmlDocument document)
{
Expand Down
4 changes: 1 addition & 3 deletions src/FluentNHibernate.Testing/Testing/XmlWriterTestHelper.cs
Expand Up @@ -7,7 +7,6 @@
using FluentNHibernate.MappingModel.Output;
using FluentNHibernate.Testing.MappingModel;
using FluentNHibernate.Utils;
using FluentNHibernate.Xml;
using NUnit.Framework;

namespace FluentNHibernate.Testing.Testing
Expand Down Expand Up @@ -37,8 +36,7 @@ public void VerifyAll(IXmlWriter<TMappingType> writer)
test.ApplyToSource(mapping);

var serializer = new MappingXmlSerializer();
object hbmFragment = writer.Write(mapping);
var xmlDoc = serializer.SerializeHbmFragment(hbmFragment);
var xmlDoc = writer.Write(mapping);

test.Check(xmlDoc);
}
Expand Down
45 changes: 0 additions & 45 deletions src/FluentNHibernate.Testing/Xml/MappingXmlSerializerTester.cs

This file was deleted.

45 changes: 0 additions & 45 deletions src/FluentNHibernate.Testing/Xml/MappingXmlValidatorTester.cs

This file was deleted.

172 changes: 0 additions & 172 deletions src/FluentNHibernate/Cache.cs

This file was deleted.

0 comments on commit 1e70497

Please sign in to comment.