public void PermissionRoleSpecification()
{
var role = new PersistenceSpecification<RoleEntity>(this.Session)
.CheckProperty(c => c.Name, this.ShortStringGenerator.GetRandomValue())
.VerifyTheMappings();
var permission = new PersistenceSpecification<PermissionEntity>(this.Session)
.CheckProperty(c => c.Name, AccessRight.Admin)
.CheckEntity(c => c.Role, role)
.VerifyTheMappings();
this.Session.Evict(permission);
this.Session.Evict(role);
role = this.Session.Load<RoleEntity>(role.Id);
Assert.That(role.Permissions.Count, Is.EqualTo(1));
}