I want to use moq a void method and set a value to a protected property when is called.
public class MyClass{ public Guid Id {get; protected set; } }
public interface IMyRespository { public void Save(MyClass myClass); }
Something like:
var moq = new Mock<IMyRespository>();
var my = new MyClass();
moq.Setup(x=>x.Save(my));
I want to setup that Id on save is no more a Guid.Empty. Save is a void method so no returns, and using:
.Callback(() => my = new MyClassImpl(new Guid("..")))
is not working..