c# - End User Style Testing of asp.net mvc web api -


i using default project of asp.net web api . want create bdd style end user testing .

i want consume web api real user in bdd way using specflow . searched 30 hours on google didn't find solution . need type of purpose .

thanks in advance .

there no special tool writing web api bdd tests using httpclient along specflow more easy. create new instance of httpclient per test , exercise api in:

  httpclient client = new httpclient();    httpresponsemessage response = await client.getasync("http://www.contoso.com/api/resource");   response.ensuresuccessstatuscode();   string responsebody = await response.content.readasstringasync(); 

you can wrap in reusable function uri parameter , use in bdd descriptions. it's on how go on here.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -