Suppose I have the following object:
public class User
{
public int Id { get; set; }
public string Username { get; set; }
public Guid UserGuid { get; set; }
public Guid ConfirmationGuid { get; set; }
}
And the following interface method:
void CreateUser(string username);
Part of the implementation is to create two new GUIDs: one for UserGuidand one for ConfirmationGuid. They must do this by setting values Guid.NewGuid().
I have already rendered Guid.NewGuid () using the interface:
public interface IGuidService
{
Guid NewGuid();
}
Therefore, I can easily make fun of it when only one new GUID is needed. But I'm not sure how to mock two different calls of the same method from the same method so that they return different values.
source
share