This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
In my unit tests, I would like to be able to set the EntityState to default, so that I can see if my code is correctly (not) changing it. However it is read only. I want to do something like: var item = EntityFactory.Create<TimesheetItem>(EntityState.Default, 45); // do something that shouldn't change the EntityState ...
...
but this won't compile at the line item.EntityState = EntityState.Default;
Any suggestions?
Sean |
|
|
Hi Sean, You have two options here: 1. Write some ugly reflection code to change the entity state - everyone loves reflection code right? 2. Grab tomorrow's nightly build dated the 10th of August. It will contain a new UpdateEntityState method on the EntityFactory class which will allow you to update the state for testing purposes :-) Appreciate the feedback, John-Daniel |
|
|
Well it's 4.40pm, so I think option 2 sounds good:). I will let you know tomorrow how it goes.
Thanks
|
|
|
Works a treat. Thanks |
|