Mock Objects properties not changing
Posted
by frictionlesspulley
on Stack Overflow
See other posts from Stack Overflow
or by frictionlesspulley
Published on 2010-05-07T22:33:24Z
Indexed on
2010/05/07
22:38 UTC
Read the original article
Hit count: 181
I am new to using Mock test in .Net.
I am testing out a financial transaction which is of the following nature:
int amt =20;
//sets all the props and func and returns a FinaceAccount.
//Note I did not SetUp the amt of the account.
var account =GetFinanceAccount()
//service layer to be tested
_financeService.tranx(account,amt);
//checks if the amt was added to the account.amt
//here the amt comes out same as that set in GetFinanceAccount.
Assert.AreEqual(account.amt ,amt)
I know that the function tranx works correctly but there is an issue with the test. Are there any GOOD reference material on Mocking in .Net
© Stack Overflow or respective owner