I have one question. What is good testing way, Microsoft.VisualStudioTestToolsUnitTesting or by Nunit_framework testing.
If I have this`
public Branch CreateOrEditBranch(Branch branch)
{
using (var scope = CreateTransactionScope())
{
}
return branch;
}
I have branch metod. and branch have properties(name,user,adress and so) , and positive test need be if all properties will be full, if not,then it will be negative test , after it will show msg , that something is wrong.
Now how can i wrote this test by good way. i wrote it like this `
public void BranchTest()
{
try {
Branch negative = new Branch()
{
AccountantPost = "Post",
Accountant = "Accoutant"`,
Address = "Address",
BankCode = "Code",
Manager = "Manager",
ManagerPost = "Post",
OpenDate = DateTime.Now,
CloseDate = DateTime.Today,
User = "marin",
Modified = DateTime.Now,
};
core.CreateOrEditBranch(negative);
}
catch (Exception ex)
{
Assert.Fail(ex.Message);
}
Is it right ?
I hope someone can help me :(
Thank you.