How to access custom webpart methods in Unittest.Tests solution

harshal bundelkhandi asked on February 25, 2019 07:28

Hi Support,I have two solutions (i.e CMS and Unit.Tests). How can I access custom webpart methods from cms solution to Unit.Tests solution? NOTE : Here I don't have namespace for custom webparts.Is it possible to provide any sample code . for For both integrated test & Automated test.also i need to test my ASCX file webpart code. with unit test.

Recent Answers


Roman Hutnyk answered on February 26, 2019 08:09

I'd recommend you to separate view (web part) and business logic, so business logic sits in a separate class (with namespace) and web part is responsible for gathering data from view and passing it to the appropriate class. In such scenario you'll need to test a class that processes data not a web part.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.