tag:blogger.com,1999:blog-15136575.post649335317495562895..comments2023-10-17T12:00:16.772+01:00Comments on Code rant: MSTest is sapping my will to liveMike Hadlowhttp://www.blogger.com/profile/16441901713967254504noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-15136575.post-89374872085800162372009-12-17T13:07:42.622+00:002009-12-17T13:07:42.622+00:00Another problem with MSTest i faced is that it doe...Another problem with MSTest i faced is that it does not support inheritance fully. See http://blogs.msdn.com/vstsqualitytools/archive/2007/05/01/known-issues-and-workarounds-for-orcas-beta1-inheritance.aspx<br /><br />-- Can someone post a work around??<br /><br />Thanks,<br />SubbuAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-60579762615473142432009-11-11T21:31:09.934+00:002009-11-11T21:31:09.934+00:00Thanks for that Stack. In fact this post is curren...Thanks for that Stack. In fact this post is currently the 3rd result for 'MSTest' in Google :)<br /><br />What's this 'Bing' thing you talk of?Mike Hadlowhttps://www.blogger.com/profile/16441901713967254504noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-68487910810818792872009-11-11T18:07:04.592+00:002009-11-11T18:07:04.592+00:00(Note: I stopped looking through the Bing results ...(Note: I stopped looking through the Bing results after the first 10 pages.)stackhttps://www.blogger.com/profile/03884473201659394970noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-33653159972392164622009-11-11T18:03:53.428+00:002009-11-11T18:03:53.428+00:00Good post. Amusing factoid: a Bing search for &qu...Good post. Amusing factoid: a Bing search for "MSTest is sapping my will to live" (unquoted) doesn't return this page, while a Google search for the same returns it as the first result. Searching for the quoted string returns this post as the first result in both engines.stackhttps://www.blogger.com/profile/03884473201659394970noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-60204129234958630652009-05-21T00:44:14.114+01:002009-05-21T00:44:14.114+01:00Ok the thing to do is delete the extra VSMDIs in t...Ok the thing to do is delete the extra VSMDIs in the Solution Explorer. Then edit the VSMDI to include the tests you've just created. <br /><br />>> moving away --- I hear rumours VS2010 will have support for XUnit - might want to consider that.preet sanghahttps://www.blogger.com/profile/07027050079768738581noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-5153170762524445972009-05-20T18:22:50.815+01:002009-05-20T18:22:50.815+01:00Preet ... thanks very much that is just what I was...Preet ... thanks very much that is just what I was looking for. I really really didn't want to create something that dumped all of the files needed into that IDE folder and then clean them up after the tests had run. <br /><br />We'll give that a try. There is actually talk in my organization about moving away from MSTest to NUnit or Spec Unit due to the amout of problems that we're having.<br /><br />I now have 4 extra VSMDI files in my solution directory ... it looks something like this:<br /><br />Project.vsmdi<br />Project1.vsmdi<br />Project2.vsmdi<br />Project3.vsmdi<br />Project4.vsmdi<br /><br />Every time I touch a test list this file is automatically checked out, a new one is created and then the IDE asks me if I want to merge<br /><br />!!!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-84131862956864450692009-05-19T21:58:56.613+01:002009-05-19T21:58:56.613+01:00Preet, thanks for helping out. Of course you very ...Preet, thanks for helping out. Of course you very welcome to post links to helpful stuff anytime :)Mike Hadlowhttps://www.blogger.com/profile/16441901713967254504noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-9357837309434402932009-05-19T21:28:00.000+01:002009-05-19T21:28:00.000+01:00Mike, I hope you don't mind me posting a link to m...Mike, I hope you don't mind me posting a link to my solution to this. <A HREF="http://preetsangha.blogspot.com/2008/06/getting-round-visual-studio-2008-mstest.html" REL="nofollow">See Here</A>preet sanghahttps://www.blogger.com/profile/07027050079768738581noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-66126906765273668452009-05-19T14:02:00.000+01:002009-05-19T14:02:00.000+01:00We're having problem number two. MSTest is attempt...We're having problem number two. MSTest is attempting to run dyamically referenced assemblies from the folder that the MSTest.exe executable is being run from. In my case this is:<br /><br />C:/Program Files/Microsoft Visual Studio 9.0/Common7/IDE/<br /><br />We've verified this by checking the AppDomain.CurrentDomain.BaseDirectory during the execution of the test.<br /><br />If anyone knows a work-around please post it, you would save me quite a bit of aggravation.<br /><br />The other problem is this VSMDI file ... this file constantly checks itself in and out everytime a test runs. Then it starts replicating itself like some kind of virus. We are managing this file under TFS ... I've read that this may not be the best idea.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-40364815107568416192009-01-28T17:16:00.000+00:002009-01-28T17:16:00.000+00:00"Now it's my practice to do this, but you shouldn'..."Now it's my practice to do this, but you shouldn't be forced to do it."<BR/><BR/>So you are complaining that MSTest is forcing you to do something... that you were going to do anyway. Jeez, whine much over nothing? ;-)mhenry1384https://www.blogger.com/profile/08330045146308399665noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-59406690739864915692008-10-22T04:18:00.000+01:002008-10-22T04:18:00.000+01:00MSTest is crap for TDD and the folks who wrote it ...MSTest is crap for TDD and the folks who wrote it know it. It wasn't designed for people who practice TDD, it was designed for Microsoft-like teams who have a dev team and a QA team. <BR/><BR/>MSTest is designed for the QA team. <BR/><BR/>Or course we don't have one of them either so my impression so far is about the same. MSTest == poopEdurardo D'Appazahttps://www.blogger.com/profile/09991349265199753550noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-13193556809280086912008-09-02T01:52:00.000+01:002008-09-02T01:52:00.000+01:00In response to woonboo, one of the biggest reasons...In response to woonboo, one of the biggest reasons I dislike MSTest is for the feature you like: Testing private code.<BR/><BR/>Except in the case of legacy code, I have found that testing privates violates encapsulation properties way too much. If you can't get to your code through a public method/property, then the code is unreachable through the clients also.<BR/><BR/>Internally scoped code can just be made available to the test assembly via "friend assemblies".<BR/><BR/>I would prefer that my testing tool not encourage me to write code that needs private code to be tested directly.<BR/><BR/>Just my 2 cents.Brianhttps://www.blogger.com/profile/09870893143113928241noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-19778690301590613392008-08-20T03:53:00.000+01:002008-08-20T03:53:00.000+01:00I know I'm late to the game, but mileage is everyt...I know I'm late to the game, but mileage is everything.<BR/><BR/>I used to use NUnit, but after using MSTest for the past 2.5 years, I wouldn't go back, even with the bugs in VS2008 (which are minor and only hit if you are doing something specific with AppDomain).<BR/><BR/>Your config file thing is simple - you don't have to use attribute...in the 'settings' (right-click properties) add files to deploy.<BR/><BR/>It creates a separate test project because too many Morts out there will just put it in the same project otherwise and all your tests will be deployed with the code. I've worked with a number of these folks.<BR/><BR/>Having the built in ability to test private and internal methods/properties/fields is the biggest reason I love it. No extra code required. No need to loosen the scope (make things public) on what you're testing.<BR/><BR/>When a test fails, looking at the test results that gives me a hyper-link to every part of the stack trace where the test failed (or threw an exception) as saved me hundreds if not thousands of hours by now not having to navigate to the file, hit CNTL+G and enter the line number; especially if I have to walk up the stack to see if there was a path taken that shouldn't of been causing the problem.<BR/><BR/>Having the ability to have tests run automatically when I do a build or check-in (easier than I was ever able to with NUnit - but that's a SCC). <BR/><BR/>Code coverage gets tied to the tests you write.<BR/><BR/>Pulling up archives into the GUI of who ran what tests when on what machines. Great from the 'team lead' perspective.<BR/><BR/>You said in another post that technologies change but methodologies don't - don't let NUnit suck you into the 'one tool' mentality (although I could say the same about myself with MSTest). Love your posts generally - but I think you need to give MSTest another chance and ask someone who's been successful with it for help. It was hard for me to switch from NUnit too - but it was like when I switched from VB to C# - I never looked back once I got past the frustration point.Brianhttps://www.blogger.com/profile/09317223425657654365noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-23027054018847985082008-07-24T15:53:00.000+01:002008-07-24T15:53:00.000+01:00Didn't know that. What did you think of the book?Didn't know that. What did you think of the book?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-83462265436421413152008-07-24T15:24:00.000+01:002008-07-24T15:24:00.000+01:00Richard, I've got that book. It's a framework too ...Richard, I've got that book. It's a framework too though:<BR/><BR/>http://www.codeplex.com/xunitMike Hadlowhttps://www.blogger.com/profile/16441901713967254504noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-61226445920679830322008-07-24T14:35:00.000+01:002008-07-24T14:35:00.000+01:00Preet,MBUnit is a framework, xUnit is the concept....Preet,<BR/><BR/>MBUnit is a framework, xUnit is the concept.<BR/><BR/>I have the book xUnit test patterns but I have yet to read it!<BR/><BR/>Glad we have stuck with NUnit now (though I have heard lots of good things about MBUnit).Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-13066323388587204952008-07-22T11:54:00.000+01:002008-07-22T11:54:00.000+01:00'the onion of compromise' - love it. This is our M...'the onion of compromise' - love it. This is our MS Test in our shop. Anyway sounds like you had a busy morning. I think you've made the right choice! Out of interest why MBUnit? Why not say XUnit?preet sanghahttps://www.blogger.com/profile/07027050079768738581noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-8568890960301519392008-07-22T11:18:00.000+01:002008-07-22T11:18:00.000+01:00Preet, it looks like I've managed to persuade our ...Preet, it looks like I've managed to persuade our team to not use MSTest. It looks like we'll be moving to MbUnit. We've just been changing the tests over this morning and it's already a lot more sane, for a start we can the Resharper test runner. <BR/><BR/>My colleage Iain described our experiences with MSTest as 'the onion of compromise'. You start out with one bad move (deciding to use MSTest) and then make one compromise after another to try and keep it working. As we've been switching to MbUnit we've been able to strip out a ton of 'compromise code'. Nice!Mike Hadlowhttps://www.blogger.com/profile/16441901713967254504noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-65705005551458045982008-07-22T09:38:00.000+01:002008-07-22T09:38:00.000+01:00Thanks Mike - no where near the level of your post...Thanks Mike - no where near the level of your posts. <BR/>If you can get the team to move do so - I would recommend it. The rapid test-code-test cycle benefits will be self evident. <BR/>I've nothing against MS stuff in general, but mstest really is a trial. On a more specific note I did some experimentation with VSMDIs and though it is possible to create these manually its not trivial as thay a have special - not quite UUID - guid in them. For VS test runner I've got into the habbit of checking out (with exclusive lock) the VSMDI before writing tests. This stops VS from creating the wonderful xxx1.vsmdi and then ...2.vsmdi files and messing with your solution files. But of course you lose the ability to allow multiple people in the same test file.<BR/><BR/>For the case of the deployment directories, you can switch this off (inside the localtestrun.config file), but doing so loses you the code coverage.<BR/><BR/>Heads you lose tail MSTest win!<BR/><BR/>On more positive note I think the ability to do bigger tests integrated into Team System is a strong point on MSTest, but we've not got the QA team to do that yet - so I cannot verify it.preet sanghahttps://www.blogger.com/profile/07027050079768738581noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-33672782764627812142008-07-22T09:00:00.000+01:002008-07-22T09:00:00.000+01:00Hi Preet, you've got some great stuff on your blog...Hi Preet, you've got some great stuff on your blog. It looks like your battle with MSTest has been a lot longer and harder than mine. I'm still hoping I can persuade our team to use NUnit or MbUnit instead. I like your suggestion about using MSTest from the command line and just pointing it at assemblies. Unfortuantely, at the moment my main issue is with the VS test runner. I've been writing tests and running them with testdriven.net, everything's fine, but when the rest of my team try to run them with the builtin test runner and there are failures all over the shop.Mike Hadlowhttps://www.blogger.com/profile/16441901713967254504noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-11731504274086542082008-07-21T23:08:00.000+01:002008-07-21T23:08:00.000+01:00Sorry for the language Mike, but I think MStest is...Sorry for the language Mike, but I think MStest is dogs poo. Been where you are and am still battling on a daily basis. <BR/><BR/>The most important thing to remember is that VSMDI (metadata) is not the be all of it. You can use TestContainers (just run MSTest.EXE /?). Have a look at http://preetsangha.blogspot.com/ for some stuff from my daily batle.preet sanghahttps://www.blogger.com/profile/07027050079768738581noreply@blogger.com