I want the EmployeeNumber property for an Employee to only be set by the database, but I need to be able to set the value for unit testing. Which is why I made the helper code below.

Can someone help me troubleshoot & fix this?

Cheers,  

Berryl

Helper Code
===========

```
public static void SetEmployeeNumberFor(Employee employee, EmployeeNumber employeeNumber)
    {
        var empNumberProperty = employee.GetType().GetProperty("EmployeeNumber", BindingFlags.Public | BindingFlags.Instance);

        Check.Invariant(empNumberProperty != null);
        Check.Invariant(empNumberProperty.PropertyType.Equals(typeof(EmployeeNumber)));

        empNumberProperty.SetValue(empNumberProperty, employeeNumber, null);
    }

```

Full Exception
==============

```
System.Reflection.TargetException : Object does not match target type.
at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
TestableEmployee.cs(36,0): at Smack.ConstructionAdmin.TestingSupport.ResourceHelper.SetEmployeeNumberFor(Employee employee, EmployeeNumber employeeNumber)
TestableEmployee.cs(47,0): at Smack.ConstructionAdmin.TestingSupport.ResourceHelperTests.SetEmployeeNumberFor()

```

EmployeeNumber property code
============================

```
    public virtual EmployeeNumber EmployeeNumber {
        get { return _employeeNumber; } 
        protected set {
            _employeeNumber = value;
            //base.BusinessId = _employeeNumber;
        }
    }
    private EmployeeNumber _employeeNumber;

```