Hi...
I am trying to assign a value to a ref parameter of a method and it doesn't seem to work. The parameter is of type DateTime in C#.
My method:
private bool IsNewFileAvailable(string file, ref DateTime localFile)
{
...
}
I need to modify the 'DateTime localFile'.
I am doing so by:
myMock.ExpectAndReturn("IsNewFileAvailable", true).Args(Check.IsAny(), new Assign(new DateTime(2005, 1, 1)));
but the the next call to IsNewFileAvailable will not modify it's reference to localFile, but keeps it's initial value (which in my case is 'DateTime myLocalFile = new DateTime();')
I am not sure what is going on because it works well with type of bool, string, List<string>, etc... but obviously not with DateTime... why?
- rick -