Questions tagged [unit-testing]
A method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures are tested to determine if they are fit for use.
32 questions
0 votes
0 answers
3 views
Azure Yaml - Error Disc fulled when publishing coverage report
I am currently adding steps to my yaml file to run units and publish the coverage report. My Test projets is on net 8.0 and my application project is on net 6.0. I have the below packages installed: ...
0 votes
1 answer
82 views
Mocking $().SPServices in JavaScript
I'm working on a legacy AngularJS application that runs on SP. In its services, it's heavily using jQuery.SPServices to fetch/save data. This has made the services untestable. Is there an easy way to ...
1 vote
1 answer
817 views
SharePoint framework unit testing pnp
How can I test with jest a pnp function? How can I mock the webpart context and pnp responses? I'm using spfx webpart, pnp-js-core and jest for unit testing Thanks.
1 vote
0 answers
102 views
How to use Jasmine tool for SharePoint client side Unit testing [closed]
I want to automate SharePoint unit testing using Jasmine tool. But I don't know how to use that in SharePoint. Can you please help us with any article or example. Also, you can suggest tool for ...
2 votes
1 answer
1k views
How can I retrieve a SharePoint online OAuth access token for unit tests?
I'm using the SharePoint 2013 Rest API in my web-application and I want to write some unit tests. GitHub has the notion of personal access token (Creating a personal access token for the commande ...
1 vote
0 answers
940 views
How to unit test a function that does not return anything using jasmine [closed]
How to unit test a function that does not return anything using jasmine. Below is my sample function function fixRightRefinementpanel() { var refinementWidth = (($(".navmenu").width() * 0.25) ...
1 vote
2 answers
1k views
How to test if a SharePoint connect is successful with user credentials using Unit testing C#
I am working on a project where I am trying to test if a user has successfully logged in with valid credentials using the Microsoft.SharePoint.Client.dll. Currently my code is checking the HTTP ...
1 vote
1 answer
39 views
How do I take the User Profile Store Offline
For testing purposes I need to take SharePoint's User Profile service offline, imitating the user profile store not having started after a reboot. Stopping the User Profile Service and User Profile ...
2 votes
0 answers
100 views
How to do regression testing of code which relies heavily on SP... classes?
I've inherited a SharePoint project and I'm at the step when I will start adding tests for regression testing. The fact that practically every method in the project relies on SPSite and similar SP... ...
1 vote
0 answers
73 views
Unit Test Sharepoint Class Library
I've built up a custom SharePoint library for creating lists, connecting to configuration lists, etc. I have added a Unit Test Project to the solution to test the class library files, but it seems my ...
0 votes
1 answer
841 views
Mock SPUser with my own data for unit testing
I'm using sharepoint 2013 and trying to unit testing for my methods. Had issues in methods having SPContext and HTTPContext but can resolve that with help of article here Now i want to test the ...
1 vote
2 answers
212 views
Static Code analysis and Testing
We want to implement static code analysis (like SPCop / SPCAF / StyleCop) and unit testing (what's the easiest way to mock SharePoint objects? Are there alternatives to Microsoft Fakes?) into our ...
1 vote
1 answer
2k views
SharePoint CSOM Unit Testing
I am currently using CSOM to upload/download files from SharePoint 2013 sites. I would like to know what would be the best way to unit test my operations. Is there a way I could create a fake ...
0 votes
1 answer
382 views
How do I integration test an SharePoint Online App?
It is my understanding that if I want to do integration testing of Apps for SPO I first and foremost need a tenant to do the testing on. The problem is, how do I run the tests? Ideally I want to use a ...
2 votes
1 answer
807 views
Unit Testing Of SharePoint Custom Code with Emulator
I am trying to test my Sharepoint custom code, using Microsoft.SharePoint.Emulator with VS2012 Premium ( because I have MSDN Premium subscription) I know its officially comes with VS Ultimate version,...