本文整理匯總了C#中System.Operation.MoneyBack方法的典型用法代碼示例。如果您正苦於以下問題:C# Operation.MoneyBack方法的具體用法?C# Operation.MoneyBack怎麽用?C# Operation.MoneyBack使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Operation
的用法示例。
在下文中一共展示了Operation.MoneyBack方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: MoneyBack_SetsBalanceToZero
public void MoneyBack_SetsBalanceToZero()
{
var stub = MockRepository.GenerateStub<IWallet>();
stub.Stub(s => s.GetBestCoins(0)).IgnoreArguments().Return(new[] { new CoinsPile(1) });
var o = new Operation(MockRepository.GenerateStub<IWallet>(), stub, MockRepository.GenerateStub<ICook>());
o.Balance = 100;
o.MoneyBack();
Assert.AreEqual(0, o.Balance);
}
示例2: MoneyBack_MockMachineWallet_TakesBestCoins
public void MoneyBack_MockMachineWallet_TakesBestCoins()
{
var mock = MockRepository.GenerateMock<IWallet>();
mock.Expect(m => m.GetBestCoins(100)).Return(new[] { new CoinsPile(1) });
var o = new Operation(MockRepository.GenerateStub<IWallet>(), mock, MockRepository.GenerateStub<ICook>());
o.Balance = 100;
o.MoneyBack();
mock.VerifyAllExpectations();
}