本文整理汇总了C#中NHibernate.Mapping.ByCode.SimpleModelInspector类的典型用法代码示例。如果您正苦于以下问题:C# SimpleModelInspector类的具体用法?C# SimpleModelInspector怎么用?C# SimpleModelInspector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SimpleModelInspector类属于NHibernate.Mapping.ByCode命名空间,在下文中一共展示了SimpleModelInspector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WhenReadonlyNotDeclaredThenIsNotPersistentProperty
public void WhenReadonlyNotDeclaredThenIsNotPersistentProperty()
{
var autoinspector = new SimpleModelInspector();
var inspector = (IModelInspector)autoinspector;
inspector.IsPersistentProperty(typeof(MyEntity).GetProperty("ReadOnly")).Should().Be.False();
}
示例2: WhenReadonlyNotDeclaredThenIsNotPersistentProperty
public void WhenReadonlyNotDeclaredThenIsNotPersistentProperty()
{
var autoinspector = new SimpleModelInspector();
var inspector = (IModelInspector)autoinspector;
Assert.That(inspector.IsPersistentProperty(typeof(MyEntity).GetProperty("ReadOnly")), Is.False);
}
示例3: ByDefaultInheritedFromObject
public void ByDefaultInheritedFromObject()
{
var autoinspector = new SimpleModelInspector();
var inspector = (IModelInspector)autoinspector;
Assert.That(inspector.IsRootEntity(typeof(Person)), Is.True);
Assert.That(inspector.IsRootEntity(typeof(Product)), Is.False);
}
示例4: IncludesReadOnlyWithField
public void IncludesReadOnlyWithField()
{
var autoinspector = new SimpleModelInspector();
var inspector = (IModelInspector)autoinspector;
PropertyInfo pi = typeof(MyEntity).GetProperty("NoReadOnlyWithField");
inspector.IsPersistentProperty(pi).Should().Be.True();
}
示例5: MatchWithCollectionPropertyAndArrayField
public void MatchWithCollectionPropertyAndArrayField()
{
var mi = typeof(Entity).GetProperty("Emails");
var autoinspector = new SimpleModelInspector();
var inspector = (IModelInspector)autoinspector;
Assert.That(inspector.IsArray(mi), Is.True);
}
示例6: WhenRelationWithTwoEntityThenIsManyToOne
public void WhenRelationWithTwoEntityThenIsManyToOne()
{
var autoinspector = new SimpleModelInspector();
autoinspector.IsEntity((t, declared) => typeof(AEntity).Equals(t) || typeof(BEntity).Equals(t));
var inspector = (IModelInspector)autoinspector;
Assert.That(inspector.IsManyToOne(typeof(AEntity).GetProperty("B")), Is.True);
}
示例7: WhenSimplePropertyThenIsNotManyToOne
public void WhenSimplePropertyThenIsNotManyToOne()
{
var autoinspector = new SimpleModelInspector();
autoinspector.IsEntity((t, declared) => typeof(AEntity).Equals(t) || typeof(BEntity).Equals(t));
var inspector = (IModelInspector)autoinspector;
Assert.That(inspector.IsManyToOne(typeof(AEntity).GetProperty("Name")), Is.False);
}
示例8: NotMatchWithByteArrayProperty
public void NotMatchWithByteArrayProperty()
{
var mi = typeof(Entity).GetProperty("Bytes");
var autoinspector = new SimpleModelInspector();
var inspector = (IModelInspector)autoinspector;
inspector.IsBag(mi).Should().Be.False();
}
示例9: MatchWithSetProperty
public void MatchWithSetProperty()
{
var mi = typeof(EntityWithSets).GetProperty("NickNames");
var autoinspector = new SimpleModelInspector();
var inspector = (IModelInspector)autoinspector;
inspector.IsSet(mi).Should().Be.True();
}
示例10: NotMatchWithByteArrayProperty
public void NotMatchWithByteArrayProperty()
{
var mi = typeof(Entity).GetProperty("Bytes");
var autoinspector = new SimpleModelInspector();
var inspector = (IModelInspector)autoinspector;
Assert.That(inspector.IsBag(mi), Is.False);
}
示例11: WhenNotExplicitlyDeclaredThenNoMatchPropertiesOutOfDefaultDelegate
public void WhenNotExplicitlyDeclaredThenNoMatchPropertiesOutOfDefaultDelegate()
{
var autoinspector = new SimpleModelInspector();
var inspector = (IModelInspector)autoinspector;
inspector.IsPersistentId(typeof(TestEntity).GetProperty("testEntityId")).Should().Be.False();
inspector.IsPersistentId(typeof(TestEntity).GetProperty("Something")).Should().Be.False();
}
示例12: MatchWithArrayProperty
public void MatchWithArrayProperty()
{
var mi = typeof(Entity).GetProperty("NickNames");
var autoinspector = new SimpleModelInspector();
var inspector = (IModelInspector)autoinspector;
Assert.That(inspector.IsArray(mi), Is.True);
}
示例13: NotMatchWithCollectionProperty
public void NotMatchWithCollectionProperty()
{
var mi = typeof(Entity).GetProperty("Others");
var autoinspector = new SimpleModelInspector();
var inspector = (IModelInspector)autoinspector;
Assert.That(inspector.IsArray(mi), Is.False);
}
示例14: NotMatchWithCollectionField
public void NotMatchWithCollectionField()
{
var mi = typeof(EntityWithSets).GetField("others", BindingFlags.NonPublic | BindingFlags.Instance);
var autoinspector = new SimpleModelInspector();
var inspector = (IModelInspector)autoinspector;
inspector.IsSet(mi).Should().Be.False();
}
示例15: NotMatchWithCollectionProperty
public void NotMatchWithCollectionProperty()
{
var mi = typeof(EntityWithSets).GetProperty("Others");
var autoinspector = new SimpleModelInspector();
var inspector = (IModelInspector)autoinspector;
inspector.IsSet(mi).Should().Be.False();
}