public void SetUp() { _cashPayment = new CashPayment(); _nets = Substitute.ForPartsOf <Nets>(); _nets.When(x => x.TransferAmount(Arg.Any <int>(), Arg.Any <string>())).DoNotCallBase(); _nets.TransferAmount(Arg.Any <int>(), Arg.Any <string>()).Returns(false); _paymentProviders = new List <IPaymentProvider> { _cashPayment, _nets }; _fakePaymentDao = Substitute.For <IPaymentDao>(); _fakeReceiptController = Substitute.For <IReceiptController>(); _fakeCashDrawer = Substitute.For <ICashDrawer>(); _fakeCashDrawer.CashChange.Returns(1000); _uut = new PaymentController(_paymentProviders, _fakeReceiptController, _fakePaymentDao, _fakeCashDrawer); _cashTransaction = new Transaction() { Description = "noget", PaymentType = PaymentType.Cash, Price = 100, }; _netTransaction = new Transaction() { Description = "noget", PaymentType = PaymentType.Nets, Price = 100, }; }
public void SetUp() { _cashPayment = new CashPayment(); _nets = Substitute.ForPartsOf<Nets>(); _nets.When(x => x.TransferAmount(Arg.Any<int>(), Arg.Any<string>())).DoNotCallBase(); _nets.TransferAmount(Arg.Any<int>(), Arg.Any<string>()).Returns(false); _paymentProviders = new List<IPaymentProvider> {_cashPayment, _nets}; _fakePaymentDao = Substitute.For<IPaymentDao>(); _fakeReceiptController = Substitute.For<IReceiptController>(); _fakeCashDrawer = Substitute.For<ICashDrawer>(); _fakeCashDrawer.CashChange.Returns(1000); _uut = new PaymentController(_paymentProviders, _fakeReceiptController, _fakePaymentDao, _fakeCashDrawer); _cashTransaction = new Transaction() { Description = "noget", PaymentType = PaymentType.Cash, Price = 100, }; _netTransaction = new Transaction() { Description = "noget", PaymentType = PaymentType.Nets, Price = 100, }; }