fixture.cs
来自「NHibernate NET开发者所需的」· CS 代码 · 共 47 行
CS
47 行
using NHibernate.Cfg;
using NUnit.Framework;
namespace NHibernate.Test.NHSpecificTest.NH693
{
[TestFixture]
public class Fixture
{
[Test]
public void Bug()
{
try
{
new Configuration()
.AddResource(GetType().Namespace + ".EmptyTableName.hbm.xml", GetType().Assembly)
.BuildSessionFactory();
Assert.Fail("should throw exception");
}
catch (MappingException e)
{
MappingException ee = e.InnerException as MappingException;
if (ee == null)
throw;
Assert.IsTrue(ee.Message.StartsWith("Could not determine the name of the table for entity"));
}
}
[Test]
public void SpaceTableName()
{
try
{
new Configuration()
.AddResource(GetType().Namespace + ".SpaceTableName.hbm.xml", GetType().Assembly)
.BuildSessionFactory();
Assert.Fail("should throw exception");
}
catch (MappingException e)
{
MappingException ee = e.InnerException as MappingException;
if (ee == null)
throw;
Assert.IsTrue(ee.Message.StartsWith("Could not determine the name of the table for entity"));
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?