public void TransferTestingFunction() { Transfer_Business Tra_bus = new Transfer_Business(); double result = Tra_bus.TransferTaka(500.0, "*****@*****.**", "*****@*****.**"); Assert.AreEqual(500.0, result); }
public void TransferTestingForNull() { Transfer_Business Tra_bus = new Transfer_Business(); int result = Tra_bus.TransferNull(500.0, "*****@*****.**", "*****@*****.**"); Assert.AreEqual(0, result); }
public void Confirm_Click(object sender, EventArgs e) { string name = Session["username"].ToString(); double amount = Convert.ToDouble(Amount.Text); string email = TEmail.Text.ToString(); double?amount1 = Convert.ToDouble(Amount.Text); if (email == null || amount1 == null) { Label2.Text = "Transaction Email/Amount Cannot be Null"; } if (amount > 0.0) { Transfer_Business Tran_Bus = new Transfer_Business(); trans_res = Tran_Bus.TransferTaka(amount, name, email); Label2.Text = "TK Transfer Successful"; Label2.ForeColor = System.Drawing.Color.Blue; } if (trans_res == 0) { Label2.Text = "Sorry! You have to have atleast 1000 TK in your account"; Label2.ForeColor = System.Drawing.Color.Red; } if (trans_res == 1) { Label2.Text = "Sorry! No Email is mathched"; Label2.ForeColor = System.Drawing.Color.Red; } if (amount < 0.0) { Label2.Text = "Amount cannot be negative"; } }