Suppose I have the following entity:
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 should create two new GUIDs: one for UserGuid
, and another for ConfirmationGuid
. They should do this by setting the values to Guid.NewGuid()
.
I already have abstracted Guid.NewGuid() using an interface:
public interface IGuidService
{
Guid NewGuid();
}
So I can easily mock this when only one new GUID is needed. But I'm not sure how to mock two different calls to the same method, from within one method, such that they return different values.