Automated Unit Testing is has now become one of the most important aspects of any project implementation. Unit Testing makes sure that code works as expected and also if there are any changes or any new functionality is implemented, running unit test makes sure that code is still behaving properly and addition of changes hasn’t broken it.
Download it from the below location.
XrmPage-Mock as the name implies mocks the XrmPage object and it functions.
To get started, create a blank ASP.NET Web Application.
Select the Empty template.
Download the latest version.
Create a new Script and CSS folder in the solution to add the Qunit and XrmPage-Mock libraries
Based on gender code, we are showing and hiding the birthdate field on the form.
Below is our Test File. It mocks the attributes used and then calls the function.
Below is the HTML page which will display the test result.
Add all the required css and js files along with the DIV as shown below.
Open the page in the browser to check the Test Results