1 / 10

Silverlight Unit Testing

Silverlight Unit Testing. About Me: Eric Hexter Director of Austin .Net User Group AspInsiders Organized the 2007 Austin Code Camp Build websites and web applications since 1996 Unit Testing since 2004 Test Infected since 2006. Agenda. What is Silverlight

clover
Download Presentation

Silverlight Unit Testing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Silverlight Unit Testing • About Me: Eric Hexter • Director of Austin .Net User Group • AspInsiders • Organized the 2007 Austin Code Camp • Build websites and web applications since 1996 • Unit Testing since 2004 • Test Infected since 2006

  2. Agenda • What is Silverlight • Why do you need a whole session on unit testing? • SilverlightRuntime • Types of Tests • Unit Test Pattern • Testing Framework Choices • Code • Async • Tips & Tricks • Resources

  3. What is Silverlight • Silverlight 2.0 • Rich Internet Application platform • It is a Web technology • Subset of the .Net Runtime • Runs cross platform – Windows/Linux/Mac • Runs cross browser – IE/Firefox/Safari • Silverlight 1.0 = Javascript • Silverlight 2.0 = .Net – C#,Vb.Net,dynamic languages….

  4. Why a session on unit testing? • The standard solutions for unit testing do not apply. • The CLR is a subset of .Net • Currently no Mocking support • All networking is Async • The Test Framework can solve solutions which were previously solved by multiple solutions.. ienUnit + Watir/ Selenium

  5. Types of Tests • Unit Test • Tests a single method for a single assertion • Integration Test • Test the interaction of multiple classes . • Can leave the process boundry. Make calls to webservices…ect. • Smoke Tests • Tests the happy path by pushing the UI to perform user based test cases.

  6. Unit Test Pattern – The 3-As • Arrange • Act • Assert • See Code Sample - UnitTestSample

  7. Testing Framework Choices • Silverlight Test Framework • Unit Tests – run all tests • Integration Tests • Smoke Tests • TestDriven.Net • Unit Tests – single test execution • nUnit(Silverlight Project Template) • Unit Tests • Some Integration Tests

  8. Using Test Framework • Show Project References • Special Project Templates • Test Framework Runner • Why Asynchronous Tests • Silverlight User Interfaces can be async. • Out of process calls are async. • Sample….

  9. Tips and Tricks • Making the Asynchronous tests palatable • Easier to read… Easier to remember months later • Less clutter / easier to meet the 3As • A fluent interface wrapper.. • Sample

  10. Resources • Eric Hexter’s Blog • http://hex.LosTechies.com • Jeff Wilcox • Jaime C

More Related