mstest

Parse Fitnesse RESTFul XML output into TFS Test format

I'm integrating a Fitnesse Acceptance test suite into a TFS based CI process. I can run the Fitnesse Test suite in a RESTful manner (http://fitnesse.org/FitNesse.UserGuide.RestfulTests): http://myfitnesseserver/MyTestSuite?suite&format=xml and get back an XML document of test results. I'd like to transform that into a format th...

MStests through TeamCity

How do you run MStests through TeamCity and the MSBUILD option? Do you put these settings in the main solution? Thanks ...

Using MSTest in VS 2010

In the test results under VS 2010, the Error message column is not very wide. If I widen the column, the error message is still truncated, less than the length of the column. It will say "Test method threw exception ..." Usually the part after the ellipses is what I am interested in. The only way to see the rest is to open up the t...

Assemblies mysteriously loaded into new AppDomains

I'm testing some code that does work whenever assemblies are loaded into an appdomain. For unit testing (in VS2k8's built-in test host) I spin up a new, uniquely-named appdomain prior to each test with the idea that it should be "clean": [TestInitialize()] public void CalledBeforeEachTestMethod() { AppDomainSetup appSetup = new A...

Is this file lock issue due to me copying the DB file for every MSTest test? (using DeploymentItem annotation)

Hi, BACKGROUND: I've running unit tests in VS2008 using MSTest. My project has a SqlLite database. I have found that I needed to arrange for the default database file to be copied to the MSTest area for the test to be able to find it. I am using the following annotation about the test code to arrange this: [DeploymentItem("dat...

Migrate from MSTest to XUnit

We are thinking about moving our tests from MSTest to XUnit. Is there any migration application that takes a MSTest and migrates it to XUnit? Also, if not, what should I look out for when doing this? Thanks. JD. ...

How to use Microsoft built in Tests with NHibernate For Repository Layer(DAL)?

Can any body tell me how to use Microsoft built in Tests with NHibernate For Repository Layer(DAL)? ...

TFS Manual Mstest Publish Results?

Following a MSDN web page, I am trying to manually run mstest within my tfsbuild.proj and put the results into the pass/fail logic so the build will fail if this particular test fails. It's kind of like running a FxCop or something else from CMD and capturing a "0" or "1" and force-fail the build. MSTest /testcontainer:test.dll /publish...

VS 2008 / MSTest - how do I run a subset of all tests?

I've just started using MSTest in a Visual Studio project (NUnit has been what I've used before) and I have a few questions. I see that if I right-click on a single test method and choose run tests, it'll test that one method. Good. But is there a way I can set up a test run that only does x of my tests of my choosing, instead of all ...

Why do MSTests Assert.AreEqual(1.0, double.NaN, 0.0) pass?

Short question, why do Assert.AreEqual(1.0, double.NaN, 0.0) pass when Assert.AreEqual(1.0, double.NaN) do not? Is it an error in MSTest or am I missing something here? Best regards, Egil. Update: Should probably add, that the reason behind my question is, that I have a bunch of unit tests that unfortunately passed due to the result o...

Trying to get selenium to start up using MSTest when running tests in Visual Studio

I'm trying to run selenium web tests in Visual Studio using MSTest. I have a selenium process class, a selenium runner class and a web dev test class, as in this article: http://keithbloom.wordpress.com/2009/10/16/running-selenium-tests-in-visual-studio/ I get the command prompt opening and I can see the selenium startup messages when I...

Fluent NHibernate PersistenceSpecification CheckList

I am currently working on a college project in which we are using Fluent NHibernate. I am working on figuring how to create testing for our entities and Fluent mappings. I have, however, hit a dead end while trying to figure how to use the CheckList of PersistenceSpecification. The unit test fails with the following error: MvcShop.Cor...

Relative path root of DeploymentItemAttribute

Using MSTest, what is the relative path root of the DeploymentItemAttribute. ...

Create Unit test methods dynamically during runtime in MSTest

Is there an equivalent of SuiteBuilder in MSTest? couldn't find one so far. I have a bunch of xml files, each to be seen as mapped to a test method. As there are 100s of these and to manually write tests for each of these, is not a good idea. So in nunit you could implement ISuiteBuilder and have the Test cases run dynamically and show...

Invoke callback in Moq

I have a method that performs an asynchronous service call. I call this class by passing in the callback. public void GetRights(EventHandler<GetRightsCompletedEventArgs> callback) { ServiceClient client = new ServiceClient(); client.GetRightsCompleted += new EventHandler<GetRightsCompletedEventArgs>(callback); client.GetRig...

The underlying connection was closed: An unexpected error occurred on a send.. Check that the Web server is still running and visible on the network.

I am getting this error when i run my ms unit test cases in the solution. If i run all the individual test cases its working and i am able to run the test cases. is there any fix for this? Am i missing something? ...

MsTest - Speed improvements

So i'm stuck with the ugly sister of NUnit. Anyone know of ways to speed this up? It appears to be keen to rebuild EVERYTHING when I just want to re-run the tests (which is not neccessary as I haven't changed any code). While we're at it does anyone know of a way to turn off the: I WILL WRITE ALL MY RESULTS TO DISK "feature" that slowly...

Unit Testing DAL - Stop Connecting when running unit tests.

I am unit testing a DAL (Data Access Layer). When I debug a unit test, before my unit test constructor is even run, Visual Studio fires up WcfSvcHost. Why is it doing that? I am mocking out everything so I can just test what little logic there is in my DAL. I don't want it to do anything but run my unit test. Any ideas on how to t...

How to write test case for mvc action filters?

Hi, I have an action filter which i got from the below link http://blog.wekeroad.com/blog/aspnet-mvc-securing-your-controller-actions/ there is something called "RequiresAuthenticationAttribute" for this i need to write test case. how can i do this? form some of the blogs i read that we need to mock httcontext. How can i mock this? wha...

VS2008 Unit Tests: Order of Execution

Folks, My apologies for the novice question. It's probably obvious, please don't laugh :-) I have unit tests defined for my Visual Studio 2008 solution. These tests are defined in multiple methods, in multiple classes across several files. I've read in a blog article that depending on the order of execution of tests is wrong; that ...