SlideShare una empresa de Scribd logo
1 de 15
Test Driving a MVVM app Emanuele DelBono  emanuele@codiceplastico.com http://blog.codiceplastico.com/ema Twitter @emadb
Who I am Dev in CodicePlastico C#WPF/ASP.NET MVC Ruby/Ruby on Rails TDD passionate UgiALT.NET founder Speaker/blogger
Agenda Very short intro to TDD 2 pomodori of live coding Q&A&Discussion
Prerequisites MVVM pattern Testing framework Test doubles (Mock/Stub)
Doubts?
MVVM in one slide View textbox button Properties listbox Commands ViewModel Model
Testing Frameworks An xUnit tool to Minimize effort in writing tests Simplify the running phase Usually is an assembly to reference in your test projects, with: A bunch of attributes to mark the test methods A bunch of asserts to verify your expectations
Test doubles To keep the focus on the tested object we need to remove all the dependencies Test doubles act as “fake” dependencies that replace the real ones Frameworks like Moq, RhinoMock, etc…came to help
TDD Test Driven Development / Test Driven Design A design practice 3 simple rules Write no production code without failing tests Write only enough test code so that it fails Write only enough production code to get your tests to pass Robert (uncle bob) Martin
Sample App A simple Todo list manager When the app starts  I want see the to do list I want to be able to add a new Item specifing a description and a due date I want to be able to delete an item I want to be able to mark an item as complete
Tools Visual Studio 2010 / Expression Blend Resharper xUnit + xUnitContrib Moq Pomodoro
First step
Let’s Code
Thanks References: Growing object oriented software – Freeman, Pryce – Addison Wesley The art of Unit Testing – RoyOsherove - Manning http://xunitpatterns.com/ http://www.mockobjects.com/ Code http://wpftodolist.googlecode.com
…un ultimacosa… 12 e 13 Giugno …ricordatevidei referendum 

Más contenido relacionado

La actualidad más candente

Windows Store Apps: Tips & Tricks
Windows Store Apps: Tips & TricksWindows Store Apps: Tips & Tricks
Windows Store Apps: Tips & Tricks
Robert MacLean
 

La actualidad más candente (20)

AngularJS – What, Why, Advantages and Disadvantages
AngularJS – What, Why, Advantages and DisadvantagesAngularJS – What, Why, Advantages and Disadvantages
AngularJS – What, Why, Advantages and Disadvantages
 
AngularJS – What, Why, Advantages and Disadvantages
AngularJS – What, Why, Advantages and DisadvantagesAngularJS – What, Why, Advantages and Disadvantages
AngularJS – What, Why, Advantages and Disadvantages
 
Structuring a Client-Side App
Structuring a Client-Side AppStructuring a Client-Side App
Structuring a Client-Side App
 
Introduction To Model View Presenter
Introduction To Model View PresenterIntroduction To Model View Presenter
Introduction To Model View Presenter
 
29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions
 
Codeception @ New Business Dept Adira Finance
Codeception @ New Business Dept Adira FinanceCodeception @ New Business Dept Adira Finance
Codeception @ New Business Dept Adira Finance
 
UI Design Patterns
UI Design PatternsUI Design Patterns
UI Design Patterns
 
MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )
 
PowerShell in the enterprise - TechED India 2011
PowerShell in the enterprise - TechED India 2011PowerShell in the enterprise - TechED India 2011
PowerShell in the enterprise - TechED India 2011
 
Code generation
Code generationCode generation
Code generation
 
Angular 5,6,7
Angular 5,6,7Angular 5,6,7
Angular 5,6,7
 
Windows Store Apps: Tips & Tricks
Windows Store Apps: Tips & TricksWindows Store Apps: Tips & Tricks
Windows Store Apps: Tips & Tricks
 
Model View Presenter (MVP) In Aspnet
Model View Presenter (MVP) In AspnetModel View Presenter (MVP) In Aspnet
Model View Presenter (MVP) In Aspnet
 
客製化的 Web api 的框架設計
客製化的 Web api 的框架設計客製化的 Web api 的框架設計
客製化的 Web api 的框架設計
 
MVVM IRL
MVVM IRLMVVM IRL
MVVM IRL
 
Create first android app with MVVM Architecture
Create first android app with MVVM ArchitectureCreate first android app with MVVM Architecture
Create first android app with MVVM Architecture
 
Visual Studio and Xamarin: The future of app development
Visual Studio and Xamarin: The future of app developmentVisual Studio and Xamarin: The future of app development
Visual Studio and Xamarin: The future of app development
 
A report on mvc using the information
A report on mvc using the informationA report on mvc using the information
A report on mvc using the information
 
Mobile applications and automation testing
Mobile applications and automation testingMobile applications and automation testing
Mobile applications and automation testing
 
20 iOS developer interview questions
20 iOS developer interview questions20 iOS developer interview questions
20 iOS developer interview questions
 

Similar a Test driving an MVVM App

Silverlight2 Unit Testing Slides
Silverlight2 Unit Testing SlidesSilverlight2 Unit Testing Slides
Silverlight2 Unit Testing Slides
Andre John Cruz
 
Automated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS SitesAutomated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS Sites
joelabrahamsson
 
Building Scalable Development Environments
Building Scalable Development EnvironmentsBuilding Scalable Development Environments
Building Scalable Development Environments
Shahar Evron
 

Similar a Test driving an MVVM App (20)

Stopping the Rot - Putting Legacy C++ Under Test
Stopping the Rot - Putting Legacy C++ Under TestStopping the Rot - Putting Legacy C++ Under Test
Stopping the Rot - Putting Legacy C++ Under Test
 
Silverlight2 Unit Testing Slides
Silverlight2 Unit Testing SlidesSilverlight2 Unit Testing Slides
Silverlight2 Unit Testing Slides
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and Adoption
 
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
Developers’ mDay u Banjoj Luci - Milan Popović, PHP Srbija – Testimony (about...
 
Simple testable code
Simple testable codeSimple testable code
Simple testable code
 
Building Maintainable Android Apps (DroidCon NYC 2014)
Building Maintainable Android Apps (DroidCon NYC 2014)Building Maintainable Android Apps (DroidCon NYC 2014)
Building Maintainable Android Apps (DroidCon NYC 2014)
 
TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0
 
Automated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS SitesAutomated Testing Of EPiServer CMS Sites
Automated Testing Of EPiServer CMS Sites
 
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd   seven years afterIan Cooper webinar for DDD Iran: Kent beck style tdd   seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
MSDN - ASP.NET MVC
MSDN - ASP.NET MVCMSDN - ASP.NET MVC
MSDN - ASP.NET MVC
 
Building Scalable Development Environments
Building Scalable Development EnvironmentsBuilding Scalable Development Environments
Building Scalable Development Environments
 
12 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 200912 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 2009
 
Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016
 
TDD Painkillers
TDD PainkillersTDD Painkillers
TDD Painkillers
 
Introducing TDD to your project
Introducing TDD to your projectIntroducing TDD to your project
Introducing TDD to your project
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Selenium
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 

Más de Emanuele DelBono

Más de Emanuele DelBono (13)

The simplest thing that could possibly work
The simplest thing that could possibly workThe simplest thing that could possibly work
The simplest thing that could possibly work
 
Una crescita armoniosa
Una crescita armoniosaUna crescita armoniosa
Una crescita armoniosa
 
A sip of Elixir
A sip of ElixirA sip of Elixir
A sip of Elixir
 
React.js in real world apps.
React.js in real world apps. React.js in real world apps.
React.js in real world apps.
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.js
 
From ActiveRecord to EventSourcing
From ActiveRecord to EventSourcingFrom ActiveRecord to EventSourcing
From ActiveRecord to EventSourcing
 
Ruby seen by a C# developer
Ruby seen by a C# developerRuby seen by a C# developer
Ruby seen by a C# developer
 
Ruby loves DDD
Ruby loves DDDRuby loves DDD
Ruby loves DDD
 
An introduction to knockout.js
An introduction to knockout.jsAn introduction to knockout.js
An introduction to knockout.js
 
Node azure
Node azureNode azure
Node azure
 
Da programmatore a CEO
Da programmatore a CEODa programmatore a CEO
Da programmatore a CEO
 
Sinatra for REST services
Sinatra for REST servicesSinatra for REST services
Sinatra for REST services
 
Mocking
MockingMocking
Mocking
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Test driving an MVVM App

  • 1. Test Driving a MVVM app Emanuele DelBono emanuele@codiceplastico.com http://blog.codiceplastico.com/ema Twitter @emadb
  • 2. Who I am Dev in CodicePlastico C#WPF/ASP.NET MVC Ruby/Ruby on Rails TDD passionate UgiALT.NET founder Speaker/blogger
  • 3. Agenda Very short intro to TDD 2 pomodori of live coding Q&A&Discussion
  • 4. Prerequisites MVVM pattern Testing framework Test doubles (Mock/Stub)
  • 6. MVVM in one slide View textbox button Properties listbox Commands ViewModel Model
  • 7. Testing Frameworks An xUnit tool to Minimize effort in writing tests Simplify the running phase Usually is an assembly to reference in your test projects, with: A bunch of attributes to mark the test methods A bunch of asserts to verify your expectations
  • 8. Test doubles To keep the focus on the tested object we need to remove all the dependencies Test doubles act as “fake” dependencies that replace the real ones Frameworks like Moq, RhinoMock, etc…came to help
  • 9. TDD Test Driven Development / Test Driven Design A design practice 3 simple rules Write no production code without failing tests Write only enough test code so that it fails Write only enough production code to get your tests to pass Robert (uncle bob) Martin
  • 10. Sample App A simple Todo list manager When the app starts I want see the to do list I want to be able to add a new Item specifing a description and a due date I want to be able to delete an item I want to be able to mark an item as complete
  • 11. Tools Visual Studio 2010 / Expression Blend Resharper xUnit + xUnitContrib Moq Pomodoro
  • 14. Thanks References: Growing object oriented software – Freeman, Pryce – Addison Wesley The art of Unit Testing – RoyOsherove - Manning http://xunitpatterns.com/ http://www.mockobjects.com/ Code http://wpftodolist.googlecode.com
  • 15. …un ultimacosa… 12 e 13 Giugno …ricordatevidei referendum 