public RoleEqualsRole(ExtentFiltered extent, IRoleType role, IRoleType equalsRole) { extent.CheckRole(role); CompositePredicateAssertions.ValidateRoleEquals(role, equalsRole); this.role = role; this.equalsRole = equalsRole; }
public RoleEqualsValue(ExtentFiltered extent, IRoleType roleType, object obj) { extent.CheckRole(roleType); CompositePredicateAssertions.ValidateRoleEquals(roleType, obj); this.roleType = roleType; if (obj is Enum) { var unitType = roleType.ObjectType as IUnit; if (unitType != null && unitType.IsInteger) { this.obj = (int)obj; } else { throw new Exception("Role Object Type " + roleType.ObjectType.SingularName + " doesn't support enumerations."); } } else { this.obj = roleType.ObjectType is IUnit?roleType.Normalize(obj) : obj; } }