June 2012 Entries
Today, I had a hard time unit testing a function to make sure a Method with some array parameters was called. Method to be called : void AddUsersToRoles(string[] usernames, string[] roleNames); I had previously used Arg<T>.Matches on complex types in other unit tests, but for some reason I was unable to find out how to apply the same logic with an array of strings. It is actually quite simple to do, T really is a string[], so we use Arg<string[]>. As for the Matching part, a ToList() ......