Hi Guys,
I have the following two methods on an interface for my service layer:
ICollection<T> FindAll<T>(Expression<Func<T, bool>> predicate) where T : Post;
ICollection<T> FindAll<T,TKey>(Expression<Func<T, bool>> predicate, OrderingOptions<T,TKey> orderingOptions) where T : Post;
They are extremely similar.
The first one (basica...
In the VS2010 Test Settings file, I've specified a .bat file that invokes a powershell script. Running the .bat file from a command prompt works just fine and the .bat returns in less than 5 secs. However, if I try to run a test, the run eventually reports a 'not executed' result and reports an error "The setup batch file on agent mach...
Some background: Im trying to implement the integration of Cruisecontrol (2.8.4), MSBuild and MSTest on my current project (.Net 4.0 and VS 2010). I'm using MSBuild to build my solution and added a MSTest as AfterBuild Target into my .csproj files to run my unit tests:
<Target Name="AfterBuild" DependsOnTargets="GetTestAssemblies" >
<...
How do you integrate MSTest and MSBuild results into specifically CruiseControl 2.8.4. I've read documentation online, but it seems to be outdated and not in line with how the later versions of cruisecontrol work.
Any suggestions?
...
Has anyone seen this very strange behaviour before?
I've got a solution whith 70 unit tests. All of them pass on my dev machine.
Whenever I commit my changes, our continuous integration process kicks in and the build box will eventually run the same 70 unit tests.
There is only ONE test in the build box that fails all the time.
The err...
I'm using MSTest and I want to write log entry before test executes and after it finishes.
Obviously I don't want to add custom logging code at the beginning and end of each test - it would only make the test unreadable and seemed like a lot of effort (I have > 500 tests)
Using TestInitialize and TestCleanup seemed like the way to go b...
Hi,
I'm using a TextContext property to access the current row in an Excel file. The test is repeated for all rows.
Is it possible to access all rows in a single step? Rows are related, hence for me one sheet should be a complete run.
Edit:
I add some code as requested:
int result = this.TextContext.Rows[0]["GlobalResult"];
foreach(va...
I installed the newest Gallio release 3.2.603 on a box without Visual Studio that will be our CI server. The NAnt script successfully built the .Net 4.0 projects but when it tries to run MSTest tests the following error occurs.
[gallio] Gallio NAnt Task - Version 3.2 build 601
[gallio] [error] Assembly XXXXXXXXXXXXXX
[gallio] Cannot r...
I setup breakpoints, then run "Run Tests" in Visual Studio. Why don't MSTest run to my breakpoints?
...
Hi
I was trying to get some tests running inside a console application
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting; // this doesn't work
The error I'm getting is:
The type or namespace name 'VisualStudio' does not exist in the namespace 'Mic...
I am using NUnit asserts within a MSTest project like as follows (NOTE: This shouldn't matter see comments to Dave Falkner's answer):
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MSTestExtensions;
using Assert = NUnit.Framework.Assert;
using Is = NUnit.Framework.Is;
This has worked great in my unit tests, but in my integr...
I'm in the process of migrating one of my projects from VS2008 to VS2010. Now that I converted all of my projects in the solution to .NET 4.0 (Client Profile) when I run the test harness, almost all tests fail with the following exception:
System.Security.VerificationException:
Operation could destabilize the
runtime.
I've been...
Is there a sample script that runs tests in a solution from msbuild script. I am using MSBuild 4.4 and visual studio 2010. Thanks.
...
I've been working on the best way to test an abstract class named TabsActionFilter. I've guranteed that classes that inherit from TabsActionFilter will have a method called GetCustomer. In practice this design seems to work well.
Where I've had some issues is figuring out how to test the OnActionExecuted method of the base class. This m...
I have extended objects of type IDataReader with some extension methods that I needed. The problem is now when I try to mock the IDataReader, the extended method is not included in the mock so when the row Expect.Call(reader.ExtensionMethod()).Return(someValue) is reach the ExtensionMethod is executed which is not what I want! I want tha...
Hi, I am trying to log some information while the unit test is running in MS Unit Testing Framework VS 2010.
I tried Trace.WriteLine, Console.WriteLine and Debug.WriteLine but I am not able to see the output in the output window.
Any idea how to do it? Thanks in advance
...
I though the whole purpose of these attributes was to run them only once per assembly. I have a simple class as follows:
[TestClass]
public class AssemblyIntegrationTestSetup
{
public AssemblyIntegrationTestSetup() { }
public TestContext TestContext { get; set; }
[AssemblyInitialize]
public static void SetupIntegrationT...
Hey all..
I am using MS Test to test one of my controller's actions. This method uses the ConfigurationManger to read appSettigns from the web.config. For some reason ConfigurationMangager is not able to find the appsettings. In NUNIT I would just make sure to add a copy of the webconfig file to the test project so that it is available ...
A colleague of mine claims that Microsoft paid the developer of NUnit to develop MSTest. I have not been able to find any information that backs this claim up.
Is this true? What is the history of MSTest?
...
I know regular ms-test unit tests can be parallelized on a multi-core machine (with caveats of course) by specifying parallelTestCount attribute in the .testresults file in the test solution. Like this,
<Execution parallelTestCount="1">
<TestTypeSpecific />
<AgentRule name="Execution Agents">
</AgentRule>
</Execution>
Mo...