none
Unit Test & integration testing. RRS feed

  • Question

  • Hello every one.

    I'm working in a VSTO Outlook Add'In and i wanted to implement test to my project.

    But i didnt find any simple response to my problem.

    How can i test my addin ? How can i test every thing that requieres Outlook to be executed ?

    I dont talk about easier test outside "Outlook Context" like a standard method, but for example, how can i test a method that insert something in the body of the mailitem ?

    Thanks.


    Wednesday, December 31, 2014 10:23 AM

Answers

  • Hi Corredera Romain,

    First, I agree with Eugene to separate the code not relative to Outlook object model.

    Second, UI testing is a very difficult part in software development. For example, in Web development, we usually tested the UI by verifying the DOM elements. Similarly, we could test the Office UI via Office Object Model.

    >>how can i test a method that insert something in the body of the mailitem ?<<

    Based on my understanding, we can build a Test method that get the body of email item after set, then compare the string get and set. However if you want to check the appearence the body like you expetect, I think it is very diffcult to achieve the goal.

    Hope it is hlepful.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, January 1, 2015 7:46 AM
    Moderator

All replies

  • Hello Romain,

    You need to run the add-in project under the debugger to test the code which depends on Outlook objects. Also I'd recommend adding log statements to the Debug configuration of your add-in. Thus, you will know what's happening in the code. It's hard to test add-ins, a lot of issues come from the Office object model.

    But you are free to create unit tests for separate pieces of code that don't require Office applications.

    You may find the similar forum thread helpful.

    Wednesday, December 31, 2014 10:46 AM
  • Thanks for your answer, but i already know how to debug, and that it will be difficult to test the Outlook part (that's why i'm posting here). =)


    The forum thread you linked is a little bit old, i hoped that something most recent exist.


    Wednesday, December 31, 2014 1:26 PM
  • Nothing was changed.
    Wednesday, December 31, 2014 2:38 PM
  • Hi Corredera Romain,

    First, I agree with Eugene to separate the code not relative to Outlook object model.

    Second, UI testing is a very difficult part in software development. For example, in Web development, we usually tested the UI by verifying the DOM elements. Similarly, we could test the Office UI via Office Object Model.

    >>how can i test a method that insert something in the body of the mailitem ?<<

    Based on my understanding, we can build a Test method that get the body of email item after set, then compare the string get and set. However if you want to check the appearence the body like you expetect, I think it is very diffcult to achieve the goal.

    Hope it is hlepful.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, January 1, 2015 7:46 AM
    Moderator