Unit Testing SharePoint Applications
-
Upload
gil-zilberfeld -
Category
Technology
-
view
1.607 -
download
3
description
Transcript of Unit Testing SharePoint Applications
![Page 1: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/1.jpg)
UNIT TESTING SHAREPOINT
APPLICATIONS
Episode IV: A New Hope
Gil Zilberfeld
Typemock
![Page 2: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/2.jpg)
Typemock
™
Who am I?
Software developer for 15 years
Technical Evangelist at Typemock
@gil_zilberfeld
• www.gilzilberfeld.com
Let me tell you about my first REAL job...
![Page 3: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/3.jpg)
Typemock
™
What’s the plan?
Unit Testing 101
Tools
Examples
Start now
o It's not that hard
![Page 4: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/4.jpg)
Typemock
™
What is unit testing?
![Page 5: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/5.jpg)
Typemock
™
Why Unit Testing?
– Reduce pain
– Improve productivity
![Page 6: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/6.jpg)
Typemock
™
Automated Unit Testing
Short feedback cycle
![Page 7: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/7.jpg)
Typemock
™
Where do I start?
![Page 8: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/8.jpg)
Typemock
™
SharePoint Development
The real world…
![Page 9: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/9.jpg)
Typemock
™
And the worst part is
![Page 10: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/10.jpg)
Typemock
™
So is SharePoint Untestable?
![Page 11: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/11.jpg)
UNIT TESTING SHAREPOINT
APPLICATIONS
Episode V:
The frameworks strike back
![Page 12: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/12.jpg)
Typemock
™
Dependencies
![Page 13: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/13.jpg)
Typemock
™
Why do we need isolation?
Applications are complex
We can’t touch a live system
When we call SharePoint
Setup
Teardown
Repeat
![Page 14: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/14.jpg)
Typemock
™
Isolation Frameworks to the Rescue
![Page 15: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/15.jpg)
Typemock
™
Fakes help me change behavior without changing the code
![Page 16: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/16.jpg)
Typemock
™
Fakes help me verify calls
![Page 17: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/17.jpg)
ISOLATION FRAMEWORKS DEMO
![Page 18: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/18.jpg)
Typemock
™
What are the differences?
![Page 19: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/19.jpg)
Typemock
™
Unit tests are the antidote to stupid bugs
it's impossible to stick with unit testing without a framework
![Page 20: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/20.jpg)
Typemock
™
Start now
It's a productivity tool
Make it part of your tool belt
![Page 21: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/21.jpg)
Typemock
™
Resources Typemock
http://www.typemock.com
Moles http://research.microsoft.com/
en-us/projects/moles/
Mock Comparison Project http://code.google.com/p
/mocking-frameworks-compare/
Me: Twitter: @gil_zilberfeld http://www.gilzilberfeld.com [email protected]
![Page 22: Unit Testing SharePoint Applications](https://reader036.fdocuments.us/reader036/viewer/2022062418/554fb7bfb4c90542018b45a3/html5/thumbnails/22.jpg)
Typemock
™
Questions?