I typically approach this by making a unit test context object that exposes reusable Mocks as public properties. The object will set up the common mocks internally and just expose them as public properties. You can potentially define many reusable mocks in this class.
Ex:
public class UnitTestContext
{
public Mock<IRepository> Repo {get;set;}
public UnitTestContext()
{
// create suitable note / subversion objects
// either by passing them in or new-ing them up directly with default values.
Repo = new Mock<IRepository>();
Repo.Setup(x => x.GetById<Note>(note.Id)).Returns(note);
Repo.Setup(x => x.GetById<SubmissionVersion>(It.IsAny<Guid?>())).Returns(subVersion.Object);
}
}
The test can then create an instance:
[Fact]
public void Some_Test_In_Need_Of_A_Mocked_Repository()
{
var ctx = new UnitTestContext();
SubmissionVersion.DeleteNote(ctx.Repo.Object, subVersion.Object, note.Id.Value);
}
I prefer this approach over defining the mocks as members in the test class since the UnitTestContext is reusable across test classes.
If you need more flexibility when it comes to return values, you can also pass in objects to the context when you construct the mocks. You can also add to the mocks outside of the class through the Repo property.