public void AddDebtorNoteTransaction_should_Throw_WhenGiven_Invalid_Params() { _transactionModel.Type = TransType.CRN.ToString(); _transactionModel.OpeningValue = 1500; _transactionModel.Value = 1500; _transactionModel.CurrencyValue = -1500; _transactionModel.OpeningCurrencyValue = -1500; _transConfiguration.SetupMocForPersistence(); var transService = new TransactionService(_transConfiguration.MockPersistence.Object, _transConfiguration.MockLog.Object, _transConfiguration.MockSecurity.Object); transService.AddDebtorNoteTransaction(_transactionModel); }
public void AddDebtorNoteTransaction_should_Save_AtLeast_Once() { _transactionModel.Type = TransType.DBN.ToString(); _transactionModel.OpeningValue = 1500; _transactionModel.Value = 1500; _transactionModel.CurrencyValue = 1500; _transactionModel.OpeningCurrencyValue = 1500; _transConfiguration.SetupMocForPersistence(); var transService = new TransactionService(_transConfiguration.MockPersistence.Object, _transConfiguration.MockLog.Object, _transConfiguration.MockSecurity.Object); var result = transService.AddDebtorNoteTransaction(_transactionModel); _transConfiguration.MockEntity.Verify(x => x.SaveChanges(true), Times.AtLeastOnce()); Assert.AreEqual(result.Value, _transactionModel.Value); }