私はしばしば、Rhino Mocks が使用可能な場合に、モッキングではなくセッターを使用するように強制する方法に関連する問題を抱えています (逆もまた同様です)。
例えば:
var foo = MockRepository.GenerateStub<IFoo>();
// Valid only if Bar has a setter (of course, otherwise it wouldn't compile)
foo.Bar = new Bar();
// Valid only if Bar does not have a setter (less obvious, as this will compile)
foo.Stub(x => x.Bar).Return(new Bar());
これらに対処することは、特にリファクタリングを行う場合、非常に面倒です。
私の質問は、Resharper/Visual Studio のショートカットをカスタマイズして、一方から他方にすばやく変換できるようにする良い方法を誰か考えてもらえますか?