+ All Categories
Home > Documents > Wp7 tdd, bdd, mocking

Wp7 tdd, bdd, mocking

Date post: 01-Nov-2014
Category:
Upload: artem-gerasimovich
View: 1,468 times
Download: 0 times
Share this document with a friend
Description:
 
Popular Tags:
12
Mocking, TDD, BDD for wp7 max paulousky www.maxpaulousky.com twitter: @paulousky This work is licensed under a Creative Commons Attribution By license.
Transcript
Page 1: Wp7 tdd, bdd, mocking

Mocking, TDD, BDD for wp7max paulouskywww.maxpaulousky.comtwitter: @paulousky

This work is licensed under a Creative Commons Attribution By license.

Page 2: Wp7 tdd, bdd, mocking

agenda

BDD

TDD

mocking

Page 3: Wp7 tdd, bdd, mocking

BDD

Based on SpecFlow library and Gherkin

syntax

I forked SpecFlow and implemented

WP7 support. Will be merged into the

main trunk

We can’t operate with Views directly –

have to work with ViewModel

Call commands

Read/write properties

Page 4: Wp7 tdd, bdd, mocking

demo

BDD

Page 5: Wp7 tdd, bdd, mocking

TDD

Create a separate testing assembly

You can use one assembly as an entry

point (reduce number of apps on your

device)

You may tag your test methods

You may test internal methods

You may test asynchronous methods

Test methods may use additional

attributes

Page 6: Wp7 tdd, bdd, mocking

demo

TDD

Page 7: Wp7 tdd, bdd, mocking

Mocking

No native support in WP7 runtime

Should use Silverlight assemblies

Can’t add a reference to WP7

assembly

Some WP7 features are not available

(XNA)

WP7 specific classes should be

wrapped with the adapter pattern,

put into containers and used as

interfaces

Page 8: Wp7 tdd, bdd, mocking

demo

mocking

Page 9: Wp7 tdd, bdd, mocking

summary

Unit test tell you that you build the

system right

Acceptance tests tell you that you build

the right system

You can use either both kind of tests or

just one

Mocking for WP7 is not trivial but

possible

Page 10: Wp7 tdd, bdd, mocking

linkswww.specflow.org/

github.com/techtalk/SpecFlow

github.com/aximus/SpecFlow

csharperimage.jeremylikness.com/2010/07/silverlight-ui-

automation-testing-using.html

www.hanselminutes.com/default.aspx?showID=267

codingsolutions.blogspot.com/2010/03/windows-phone-7-tdd-kata-

using-mvvm-and.html

www.linkedin.com/groups?home=&gid=3405242&trk=anet_ug_hm

stackoverflow.com/questions/4137528/ui-automation-for-wp7

www.smartypantscoding.com/a-cheat-sheet-for-unit-testing-

silverlight-apps-on-windows-phone-7

http://msdn.microsoft.com/ru-ru/magazine/gg490346.aspx

Page 11: Wp7 tdd, bdd, mocking

thanks

max paulouskywww.maxpaulousky.comtwitter: @paulousky

This work is licensed under a Creative Commons Attribution By license.

Page 12: Wp7 tdd, bdd, mocking

questions


Recommended