public void TestEnqueToReceiptOk(decimal entryVal, decimal charges, decimal saldo) { //Input var entry = EntryFactory.Build(x => { x.Type = "receipt"; x.FinancialCharges = charges; x.Value = entryVal; }); //behavior var account = AccountFactory.Build(); _mockAccountRepository.Setup(m => m.FindOrCreateBy(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())) .Returns(account); var balance = BalanceFactory.Build(x => x.Total = saldo); _mockBalanceRepository.Setup(m => m.LastByOrDefault(It.IsAny <Account>(), It.IsAny <DateTime>())) .Returns(balance); _mockReceiptQueue.Setup(m => m.Enqueue(entry, null)).Verifiable(); //It.IsAny<Entry>( //test var val = _service.EnqueueToReceive(entry); //assert Assert.IsInstanceOf <OkDTO>(val.Result); Assert.AreEqual(entry.UUID, ((OkDTO)val.Result).UUID); _mockReceiptQueue.Verify(x => x.Enqueue(entry, null), Times.Once()); }