Skip to main content

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
3 views

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: ...
Keshav Taurah's user avatar
0 votes
1 answer
85 views

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 ...
Ε Г И І И О's user avatar
1 vote
1 answer
820 views

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.
Fabio Valencia's user avatar
1 vote
0 answers
104 views

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 ...
Akshay Dattatray Nangare's user avatar
2 votes
1 answer
1k views

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 ...
ggbt's user avatar
  • 21
1 vote
0 answers
940 views

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) ...
MJaiswal's user avatar
  • 498
1 vote
2 answers
1k views

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 ...
jdave's user avatar
  • 159
1 vote
1 answer
48 views

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 ...
George Grainger's user avatar
2 votes
0 answers
104 views

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... ...
Arseni Mourzenko's user avatar
1 vote
0 answers
78 views

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 ...
KidBatman's user avatar
  • 381
0 votes
1 answer
848 views

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 ...
Sivakumar Nagasamy's user avatar
1 vote
2 answers
221 views

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 ...
Markus's user avatar
  • 357
1 vote
1 answer
2k views

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 ...
Sudipto's user avatar
  • 21
0 votes
1 answer
383 views

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 ...
Gabriel Smoljar's user avatar
2 votes
1 answer
811 views

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,...
Nazish Ali Rizvi's user avatar
3 votes
2 answers
3k views

I have an application which uploads a file to SharePoint via client object model. Now I need to write unit test cases for this application. The problem is, I how do I write test cases for the ...
Aditi's user avatar
  • 141
1 vote
1 answer
250 views

The following code throws an UnauthorizedAccessDenied exception (0x80070005) when run as a unit test in MSTest, however it works when run on a web page. The username is my domain user: [TestClass] ...
Daniel's user avatar
  • 549
1 vote
0 answers
66 views

Recently, I tried to write a unit test for my new SharePoint project. The Project contains EventListener which checks a TaxonomyField in a special list, and fill it, if field is empty. Code looks ...
shaman's user avatar
  • 41
4 votes
2 answers
4k views

I've been tasked with writing a small C# tool to fetch and fiddle with some Sharepoint 2010 items using the Sharepoint Client Object Model (COM). The code will typically have something like this in ...
Frode's user avatar
  • 93
0 votes
1 answer
382 views

I'm trying the SharePoint Emulator and wanted to emulate the access to a userprofile. But when trying to get SPServiceContext from an emulated site my SPServiceContext is null. Any Idea?
Steffen Schindler's user avatar
3 votes
1 answer
3k views

I created a web service hosted in SharePoint 2010 and I want to unit test its behaviour/results. Now when I try to run a test with a different user, I always get the results of the previous user and ...
Max Melcher's user avatar
  • 2,549
2 votes
0 answers
143 views

I am using SharePoint 2010 and we have switched to using Claims Based Authentication. When I run unit tests and running code with elevated privileges the web.CurrentUser.LoginName is "MYDOMAIN\...
Cowborg's user avatar
  • 1,037
1 vote
1 answer
519 views

I have a SharePoint 2010 project in VS 2010, and I'm trying to develop some unit tests to test my code. I have followed all of the instructions here to prepare my VS2010 environment to re-target the ...
Dylan Cristy's user avatar
  • 12.9k
4 votes
2 answers
495 views

I'm working on a sharepoint project, and the associated visual studio solution contains several projects, of which some are plain c# class libraries. I would like to unit test those projects, but each ...
claesv's user avatar
  • 305
0 votes
1 answer
640 views

I have a CAML query in a class and I'm using unit test to cover my code with some proper test. For the SharePoint classes and stuff, I use TypeMock to mock the SharePoint objects. I would like to ...
Philippe Lavoie's user avatar
1 vote
2 answers
429 views

Recently I have been assigned a task to implement Unit Testing for my SharePoint object model code. I have gone through the "MSDN" reference. I am stuck now. I would like to know the difference ...
Share's user avatar
  • 483
2 votes
1 answer
158 views

I'm setting up a project in which I want to include a unit test project for testing. I'm testing this with the new TFS Online preview (dev 11), so I want to use a continuous build to test each check-...
Jasper's user avatar
  • 1,274
1 vote
0 answers
196 views

was following a tutorial on pex and moles (http://research.microsoft.com/en-us/projects/pex/pexsharepoint.pdf). Its a year old, but everything worked fine until I changed Mole types to Behaved types. ...
Necros's user avatar
  • 111
9 votes
1 answer
1k views

Everything i read about unit testing mentions TypeMock isolator. thats good when you can control what unit testing and mocking tools you are using in the project but I am unable to use TypeMock. ...
Mauro's user avatar
  • 1,110
1 vote
2 answers
732 views

Its sort of an open ended question but can anybody share the experiences, approaches, tools and infrastructure to implement following in their SharePoint Projects: Unit Testing Performance Testing ...
Namwar Rizvi's user avatar
0 votes
1 answer
445 views

I have some code that creates a SharePoint site. When the code runs as part of the solution it works. However, when I run it as a unit test I get the following error: The test adapter '...
Shiraz Bhaiji's user avatar
5 votes
3 answers
1k views

I've read the articles from Andrew Woodward (21Apps) trying to get started with unit testing on WSS, but when I try something more advanced, like Webpart connections, I don't know how to start ...