Tagged Questions

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.

learn more… | top users | synonyms

0
votes
0answers
21 views

Visual Studio 2012 cache Unit Test results of SharePoint solutions

It's my first time with Unit Tests in SharePoint and I've noticed some strange behaviour. I have a solution with 2 projects: Project ProjectTest My test method: [TestMethod] public void ...
1
vote
0answers
21 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
1answer
48 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
0answers
76 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
1answer
161 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
1answer
44 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
1answer
204 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 ...
0
votes
0answers
32 views

set properties for ShimFileCreationInformation object

I am writing some unit test cases using fakes framework. I am using an object ShimFileCreationInformation from Microsoft.SharePoint.Client.Fakes namespace. Now, I pass this object to a function. ...
3
votes
2answers
397 views

Sharepoint unit testing using fakes framework

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 ...
1
vote
1answer
83 views

Creating a site collection in a unit test

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] ...
1
vote
0answers
43 views

UnitTest for SharePoint.EventListener with TaxonomyField

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 ...
2
votes
1answer
582 views

Mocking Client Object Model's ClientContext with Moles

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 ...
0
votes
1answer
189 views

SharePoint Emulator - How to Emulate SPServiceContext for getting Userprofiles

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?
2
votes
1answer
661 views

WebClient and impersonate as other user

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 ...
1
vote
0answers
70 views

Elevated Account during unit testing when using Claims Based Authentication

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 ...
1
vote
1answer
252 views

SharePoint and Unit Testing - problem deploying dll to be tested

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 ...
3
votes
2answers
212 views

Unit testing in sharepoint solution

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 ...
0
votes
1answer
297 views

How can I test a CAML query using mocking?

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 ...
1
vote
2answers
342 views

SharePoint 2010 Object Model using Moles Framework?

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 ...
2
votes
1answer
117 views

Using object model in automated unit test

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 ...
1
vote
0answers
165 views

SharePoint Behaved Types - Run Pex Explorations error (System.Moles 4.0.0.0)

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. ...
6
votes
1answer
522 views

Moq'ing SharePoint for Unit tests

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. ...
1
vote
2answers
520 views

Unit Testing / Performance Testing approaches for SharePoint Projects

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 ...
0
votes
1answer
368 views

Unit test for creating a SharePoint site fails

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 ...
4
votes
3answers
802 views

Unit testing web parts

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 ...