标签:style blog color os sp div on log bs
MockRepository mocks = new MockRepository(); ISongBird maleBird = (ISongBird)mocks.StrictMock(typeof(ISongBird)), femaleBird = (ISongBird)mocks.StrictMock(typeof(ISongBird)); using (mocks.Ordered()) { maleBird.Eat("seeds", 250); femaleBird.Eat("seeds", 250); } using (mocks.Ordered()) { maleBird.Mate(femaleBird); femaleBird.Mate(maleBird); } mocks.ReplayAll(); maleBird.Mate(femaleBird); femaleBird.Mate(maleBird); maleBird.Eat("seeds", 250); femaleBird.Eat("seeds", 250); mocks.VerifyAll();
总之用Ordered就可以次序调用了,上面是官方的例子。
标签:style blog color os sp div on log bs
原文地址:http://www.cnblogs.com/FEAUOR/p/4093913.html