Getting Started with Unit Testing Part 2

Sign in to queue

Description

This is another in Robert's Getting Started series, where he provides an introduction to a topic that everyone knows about but not everyone is actually doing (or doing enough of). In part 1 of this 3 part series, Robert showed how to get started with unit testing in Visual Studio. In this episode, he shows how to write unit tests that test the UI interactions in a XAML application. He then shows how to create data-driven tests and how to perform a code coverage analysis to determine what parts of your code are being covered by unit tests.

You can find the sample code and demo scripts for the entire 3 part series here.

Embed

Download

The Discussion

  • User profile image
    David Gallivan

    Excellent session. The tips on using commands, data drive testing will help me greatly. Cant wait for session 3

    David

  • User profile image
    Mindaugas

    Thanks for great and useful series, Robert. I wanted to ask what is the extension you are using to show memory usage of Visual Studio as it can be seen on top of the IDE?

    Mindaugas

  • User profile image
    tinleusa

    Hi Robert,

    Thanks, it is great,

    Could you please have the part2 codes to download?

    Thanks

  • User profile image
    LarHel

    Would be nice if you posted the code so it can be downloaded.

    Please also do a part 4 where you perhaps could go into some more advice on testing from perhaps real "big Solutions".

  • User profile image
    rogreen

    @Mindaugas: That is an internal only extension, sorry.

    Robert 

  • User profile image
    David

    Hi,
    Just watched the video and it was very helpful for using commands and the data driven tips. I'm looking forward to no.3. What do you plan to put in the next episode - perhaps mocks, and web app testing?
    Also I have a general question about what to test and if you might discuss this.I am always under time pressure and it is not possible to test everything. My general rule of thumb is to test the core functionality ie the reason for the software existing, rather than say database updates. What do you think?
    Thanks
    David

  • User profile image
    diegosousa88

    Robert,

    Could you provide the before code to download so we can pratice your content in this post.
    This time you do not started from the scratch as you do in part 1.

    Best regards.
    Diego

  • User profile image
    rogreen

    @tinleusa: You can find the code and demo scripts here.

    Robert

     

  • User profile image
    rogreen

    @diegosousa88: You can find the code and demo scripts here.

    Robert

  • User profile image
    diegosousa88

    Cool @rogreen let's practice it! 

    Thank you very much.

  • User profile image
    Doctor Who

    I'm really enjoying this training, Rob!

    I've downloaded the .zip file and extracted everything. In the zip file there's two folders, one is Calculator Solution and the other is Calculator Solution End. It looks to me as though Calculator Solution is the solution without any of the unit testing projects. Calculator Solution End requires me to connect to your TFS repository before I can open the solution. I'll give it a try, and I hope it will only allow me to connect as a guest.

    ----

     

    I opened the Calculator Solution End solution, it did ask to get connected to your TFS. Here's the error it gave me:

    Generic Comment Image

    But I think it's OK.

  • User profile image
    rogreen

    @Doctor Who: You can just click OK here. I included that End solution so that you wouldn't have to recreate all the unit tests if you didn't want to.

    Robert

  • User profile image
    josejacob99

    Awesome,Thank you so much.

  • User profile image
    SunnyKumar08

    @rogreen: thanks for the series, you're awesome! 

Add Your 2 Cents