Hi,
I'm following the first video in the Summer of NHibernate here
http://summerofnhibernate.com/ (Session 01). I have created my own
project and am following along and my project builds, but when I try
to run the Unit Test (I am using NUnit 2.5.5) I get this error:
------ Test started: Assembly: MooDBTests.dll ------
Test 'MooTests.MarketTests.CanGetMarketBySymbol' failed:
NHibernate.InvalidProxyTypeException : The following types may not be
used as proxies:
MooDB.Market: type should have a visible (public or protected) no-
argument constructor
at NHibernate.Cfg.Configuration.ValidateEntities()
at NHibernate.Cfg.Configuration.Validate()
at NHibernate.Cfg.Configuration.BuildSessionFactory()
NHibernateDataProvider.cs(15,0): at
MooDataLayer.NHibernateDataProvider.GetMarketBySymbol(String Symbol)
MarketTests.cs(35,0): at MooTests.MarketTests.CanGetMarketBySymbol()
0 passed, 1 failed, 0 skipped, took 0.68 seconds (NUnit 2.5.5).
MooDB.Market class looks like this:
public class Market
{
private string _symbol;
private string _description;
public Market(
string Symbol,
string Description
)
{
_symbol = Symbol;
_description = Description;
}
public virtual string Symbol
{
get
{
return _symbol;
}
set
{
_symbol = value;
}
}
public virtual string Description
{
get
{
return _description;
}
set
{
_description = value;
}
}
}
My test looks like this:
[Test]
public void CanGetMarketBySymbol()
{
MooDataLayer.NHibernateDataProvider provider = new
MooDataLayer.NHibernateDataProvider();
Assert.AreEqual("EURUSD",
provider.GetMarketBySymbol("EURUSD"));
}
Any ideas on how to fix this error?
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.