locked
Pex, Controls, (Windows) Designs and Asserts on Returned Objects RRS feed

  • Question

  • Hi,
    I just noticed that when you run Pex on Control/Control Library to generate tests, and then execute the tests on a different machine (e.g. build server), then you may get a lot of errors when the machines are configured differently.
    Like if you have the Designs activated on the Developer machine, but not on the build server.
    In that case the Control sizes may be different, but Pex adds asserts for them. (At last in my Project)
    Is there any way workaround this, without having to try to execute them on different machines/configurations and manually editing the generated tests ?
    Saturday, September 12, 2009 9:19 AM

Answers

  • Hi Alexander,

    we discussed in this thread
    http://social.msdn.microsoft.com/Forums/en/pex/thread/df4435a5-249d-46ce-a0bb-a0216b0f6e77
    the possibility of adding to Pex a way to exclude certain properties from being mentioned in the generated assertions, for example, as you mentioned:
    [assembly: PexAssertExclude(typeof(Class1), "Stack")]

    We haven't actually implemented such attributes yet, but it would still be my preferred solution.

    Would that help you here for the problem you described?

    Thanks,
    NIkolai Tillmann
    Sunday, September 13, 2009 12:43 AM
  • The next version of Pex (0.16) will allow to exclude properties/field to be asserted. See referenced thread for details.


    Jonathan "Peli" de Halleux
    Tuesday, September 15, 2009 2:21 PM

All replies

  • Hi Alexander,

    we discussed in this thread
    http://social.msdn.microsoft.com/Forums/en/pex/thread/df4435a5-249d-46ce-a0bb-a0216b0f6e77
    the possibility of adding to Pex a way to exclude certain properties from being mentioned in the generated assertions, for example, as you mentioned:
    [assembly: PexAssertExclude(typeof(Class1), "Stack")]

    We haven't actually implemented such attributes yet, but it would still be my preferred solution.

    Would that help you here for the problem you described?

    Thanks,
    NIkolai Tillmann
    Sunday, September 13, 2009 12:43 AM
  • Hi Nikolai,
    Yes it would help, but If we take the machine configuration into consideration, there may be a lot of things that could change, depending how much of your code is dependent on the actual configuration. (e.g. colors, font, size, ...)
    So I was thinking if there is another better way, to do this, but I guss the extra work wouldn't be worth it (yet).

    Also, If you execute a property like this, what if you have a tests for that property/method ?
    Would that (return value) assert also be executed ?

    Anyway thanks for the reminder.
    Sunday, September 13, 2009 10:36 AM
  • The next version of Pex (0.16) will allow to exclude properties/field to be asserted. See referenced thread for details.


    Jonathan "Peli" de Halleux
    Tuesday, September 15, 2009 2:21 PM