Unit testing your silverlight applications using the silverlight unit testing framework
Download
1 / 13

Unit Testing your Silverlight Applications Using the Silverlight Unit Testing Framework - PowerPoint PPT Presentation


  • 120 Views
  • Uploaded on
  • Presentation posted in: General

Unit Testing your Silverlight Applications Using the Silverlight Unit Testing Framework. By, Ben Dewey Senior Software Developer twentySix New York http://bendewey.com/blog http://twitter.com/bendewey. Assumptions. Basic knowledge of Silverlight Unit Testing Nice to have knowledge of

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Unit Testing your Silverlight Applications Using the Silverlight Unit Testing Framework ' - orrin


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Unit testing your silverlight applications using the silverlight unit testing framework

Unit Testing your Silverlight Applications Using the Silverlight Unit Testing Framework

By, Ben Dewey

Senior Software Developer

twentySix New York

http://bendewey.com/blog

http://twitter.com/bendewey


Assumptions
Assumptions Silverlight Unit Testing Framework

  • Basic knowledge of

    • Silverlight

    • Unit Testing

  • Nice to have knowledge of

    • MSTest


Overview
Overview Silverlight Unit Testing Framework

  • What is Testing/TDD

  • Setting up the Silverlight Unit Testing Test Harness

  • Basic Unit Test

  • Asynchronous Unit Tests

  • Questions


Preface
Preface Silverlight Unit Testing Framework

  • Unit Testing (MSTest)

[TestMethod]

publicvoidCan_CreateCar()

{

// Arrange

// Act

var car = newCar();

// Assert

Assert.IsNotNull(car);

}

  • Test Driven Design (TDD)

    • Testing first and allowing your tests/requirements to drive your design


Original unit testing framework
Original Unit Testing Framework Silverlight Unit Testing Framework


April 2010 silverlight toolkit
April 2010 Silverlight Toolkit Silverlight Unit Testing Framework

  • http://silverlight.codeplex.com


Context
Context Silverlight Unit Testing Framework


Setting up the test harness
Setting up the Test Harness Silverlight Unit Testing Framework

  • Add Project

    • Silverlight Unit Testing Applications


Setting up the test harness1
Setting up the Test Harness Silverlight Unit Testing Framework

  • Add References

    • Microsoft.Silverlight.Testing

    • Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight

  • Modify App.xaml.cs

private voidApplication_Startup(object sender, StartupEventArgs e){RootVisual = UnitTestSystem.CreateTestPage();}


Asynchronous unit tests
Asynchronous Unit Tests Silverlight Unit Testing Framework

[TestClass]    public classMainPageTests : SilverlightTest    {

        [TestMethod, Asynchronous]        public voidCan_ShowHide_Windows()        {            // Arrangevar controller = new GameController();varmainPage = new MainPage(controller);this.TestPanel.Children.Add(mainPage);varstartWindow = mainPage.FindName("StartWindow") asUIElement;varendWindow = mainPage.FindName("EndWindow") asUIElement;            // Act            // AssertEnqueueDelay(500);EnqueueCallback(() =>            {controller.ShowStartScreen  = false;Assert.AreEqual(Visibility.Collapsed, startWindow.Visibility);Assert.AreEqual(Visibility.Collapsed, endWindow.Visibility);            });EnqueueDelay(500);EnqueueTestComplete();        }

    }


Links
Links Silverlight Unit Testing Framework

  • http://silverlight.codeplex.com

  • http://www.jeff.wilcox.name/

    • Jeff Wilcox – Creator of SUT


Microsoft design toolbox
Microsoft Design Toolbox Silverlight Unit Testing Framework

http://microsoft.com/design/toolbox


Thank you

Thank You Silverlight Unit Testing Framework

By, Ben Dewey

http://bendewey.com/blog

http://twitter.com/bendewey


ad
  • Login