public void PositiveTestAddFundsInMetal() { var account = new MetalAccount("acc1", "client1", MetalType.Argentum, 0, 500M); var result1 = account.AddFundsInMetal(100); var result2 = account.AddFundsInMetal(0); Assert.AreEqual(true, result1); Assert.AreEqual(true, result2); Assert.AreEqual(50000M, account.AccountBalance); Assert.AreEqual(100, account.MetalBalance); }
public void NegativeTestAddFundsInMetal() { var account = new MetalAccount("acc1", "client1", MetalType.Aurum, 0, 1500M); account.CloseAccount(); var result = account.AddFundsInMetal(50); Assert.AreEqual(false, result); Assert.AreEqual(0M, account.AccountBalance); Assert.AreEqual(0L, account.MetalBalance); }
public void NegativeTestWithdrawFunds() { var account = new MetalAccount("acc1", "client1", MetalType.Aurum, 0, 1500M); account.AddFundsInMetal(1); var result1 = account.WithdrawFunds(3000M); Assert.AreEqual(false, result1); Assert.AreEqual(1500M, account.AccountBalance); Assert.AreEqual(1, account.MetalBalance); try { account.WithdrawFunds(-1500M); Assert.Fail(); } catch (InvalidOperationException) { } try { account.WithdrawFunds(1000M); Assert.Fail(); } catch (InvalidOperationException) { } Assert.AreEqual(1500M, account.AccountBalance); Assert.AreEqual(1, account.MetalBalance); account.ZeroingAccount(); account.CloseAccount(); var result2 = account.WithdrawFunds(1500M); Assert.AreEqual(false, result2); Assert.AreEqual(0M, account.AccountBalance); Assert.AreEqual(0L, account.MetalBalance); }