1
我經常遇到與Rhino Mocks強制使用setter的方式有關的問題,而不是模擬(反之亦然) 。Resharper挑戰:使用.Mock()。返回()而不是setters,反之亦然
例如:
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的快捷方式,可以讓我快速從一個轉換到另一個?
您可以將嚴重性級別設置爲「不顯示」,對不對? – AakashM 2012-07-06 08:03:57
是的,但不能使用快捷方式執行它。 – cbp 2012-07-06 08:18:20
啊當然。你可以設置它提示(所以你得到的是最微弱的虛線下劃線)? – AakashM 2012-07-06 08:29:04