c# - Delete User Unit test -


i new unit testing , dont "see" needs tested. creating unit test verify user has been deleted app.

here have far. can take , make recommendations other things test or have covered of delete user account?

            membershipprovider prov = this.getmembershipprovider();             membershipcreatestatus status;             membershipuser user = prov.createuser("userx", "12345", "test.userx@abc.com", "", "", true, null, out status);              //call user             user = prov.getuser("userx", false);               //deletes user , related information             prov.deleteuser("userx", true);              // try retrieve user again             user = prov.getuser("userx", false);              //test see if user has been deleted             assert.areequal(null, user); 

you should check status , user expect after call createuser().

after first call user = prov.getuser("userx", false); should check user expect. example, check not null , username correct.

it's not clear whether deleteuser() has return value or not. if does, make sure value checked.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -