简体   繁体   中英

calling application functions via fixtures in .Net

I am trying to write fit tests for my SUT. I would like to call stored procs to create data in DB etc before I run the tests. Could anyone please post sample code on how to call application functions via fixtures and connect to DB and call stored procs in .Net. And should fit tests reside in the Same Solution as the Application. Or it could be in a different solution ?

Your question is very general and in fact is several questions. Look at the following links and see if you can get your tests written. If you have problems, post specific questions with examples of what you tried and what results you got.

Check out DbFit for calling stored procedures: https://fitsharp.github.io/DbFit.html and http://dbfit.github.io/dbfit/docs/reference.html#execute-procedure

Here's how to call application functions directly from a test: https://fitsharp.github.io/Fit/MethodExecution.html

You can find lots of sample code here https://github.com/jediwhale/fitsharp/tree/master/source just look at all the classes starting with "Sample"

Usually I put Fit test code in the same solution as the application but you could use a separate solution too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM