Pengecualian Pengaturan Xunit


Mock<ISomeObj> someObj = new Mock<ISomeObj>();

//NOTE the Throws method
someObj.Setup(s => s.Get())
  .Throws(new IOException());
Upvote answer :-)