mstest

Selenium WebDriver tests fail with System.Net.WebException Unable to connect

限于喜欢 提交于 2019-12-05 22:08:20
I'm working on a suite of Selenium WebDriver (not Selenium RC and not using Selenium-Server) tests that are being executed by a command-line call to MSTest. I've broken them into test classes for each browser we plan on testing (Chrome, Firefox and IE9, for now) and each test class has a startup method that logs in to the system under test and then executes the test(s) requested and a TearDown method that closes the browser using WebDriver.Quit(). On my development machine everything is hunky-dory, but on our build machine the class initialization/start-up method executes fine and logs into

Unit testing: Sending complex object as a input parameter to my test method using MSTest

别等时光非礼了梦想. 提交于 2019-12-05 20:05:22
I'm trying to send a List<DataStatusItem> as a input parameter to my unit test method using DataRow attribute as below, [TestClass] public class UpdateProcessingTestController { private List<DataStatusItem> DataStatusItemsTestSetup = new List<DataStatusItem>() { new DataStatusItem { DataItemID = 1, DataItemCurrentStatusID = 1, DataItemStatusID = 1, DateEffective = DateTime.Now } }; private readonly Mock<IEmployee> moqEmployee; public UpdateProcessingTestController() { moqEmployee = new Mock<IEmployee>(); } [TestMethod] [DataRow(DataStatusItemsTestSetup, 1, 8, 1)] // **This is where it is

How to both package with msbuild and run tests on TFS 2010 using Continuous Integration

馋奶兔 提交于 2019-12-05 19:40:06
I am using TFS2010 and MSBuild to integrate a windows azure cloud solution to the CI. To create the required 2 files for deployment I added in the "MSBuild Arguments" the /t:Publish Here is the configuration I use in TFS to build the packages: Problem is : if I remove all arguments the tests are built correctly but no azure package is built as seen on the build results: Tho if I put the parameters the package is there but the test are not run : Is there a way to have both ? I had discussion about your problem with TFS Team and I was told that as of now with TFS2010 this functionality is not

Getting started with automated integration/unit testing in an existing code base

て烟熏妆下的殇ゞ 提交于 2019-12-05 19:05:12
Background: We have been handed over a very large codebase (1.4 million lines) that is primarily in C#. The application consists primarily of asp.net 2.0 style asmx web services accessing data in a SQL server 2008 database and also in various XML files. There are no existing automated tests in place. We have an automated nightly build in place (CC.NET). We want to introduce some level of automated testing, but refactoring in granular level unit tests for this amount of code seems unlikely. Our first thought is to find a way to construct automated tests that simply call each web service with a

how to run an mstest dll from command line

北战南征 提交于 2019-12-05 19:00:53
anybody knows how to run unit test dlls built using mstest from the command line, without running VS considering that on the machine there is .net 4.0 and VS2010 installed I haven't done it myself, but I'd imagine that using the mstest command line is the way forward... if you've already tried that and had problems, please give more details. mstest /testcontainer:path\to\tests.dll EDIT: As noted in comments, you should either do this after putting the right directories on the path, or include the full path to mstest.exe. Quick Answer : Examples You must use the /testcontainer option together

Unit Test configuration for ASP.NET application

给你一囗甜甜゛ 提交于 2019-12-05 18:56:18
This is my first test for Asp.Net Web Application. We have an Engine consisting of several modules. I need to test classes in Engine Module. Though these clases are part of Asp.Net App, they consists of only business logic. How can I test these classes in isolation other being part of WebApp ? because i am getting this error The Web request ' http://localhost:8936/ ' completed successfully without running the test. This can occur when configuring the Web application for testing fails (an ASP.NET server error occurs when processing the request), or when no ASP.NET page is executed (the URL may

TeamCity + MSTest - Run only failed tests?

不羁岁月 提交于 2019-12-05 15:46:51
Is there a way to run only failed tests from a previous test run in TeamCity? Even better, is there a way to run only selected tests in some way? Like if we want to run only certain test classes. Is there another mechanism we can accomplish this with? Maybe passing some kind of configuration file to MSTest on subsequent test run? The reason I ask this, is we have employees that do not use Visual Studio, but they still need to run certain tests to see what is failing. You can group those tests in a category. http://msdn.microsoft.com/en-us/library/dd286683.aspx Use the "Additional commandline

Why is Private Accessor deprecated?

浪尽此生 提交于 2019-12-05 15:17:02
It used to be the number one reason for us to choose MSTest from others that we could access and test private methods. Now that Private accessors are deprecated in Visual Studio 2012 . Does anyone know why Microsoft make such decision? Is it because it's not a good practice to test private methods? Also, if I still need to unit test my private methods, how could I do that in VS 2012 and later versions? According to VS team article Generation of Private Accessors... this feature was deprecated in 2010 for following reasons: Lack of resources and time : The focus for this release has been to

Visual Studio Code + MSTEST?

孤街浪徒 提交于 2019-12-05 14:57:25
Is there a way to run and debug MSTest V2 from Visual Studio Code? I'm stumped. It runs great from the command line: dotnet test produces expected results. Here's what my current launch.json looks like: "configurations": [ { "name": ".NET Core Test (Serialization)", "type": "coreclr", "request": "launch", "preLaunchTask": "build", "program": "${workspaceRoot}/Fact.Extensions.Serialization.Tests/bin/Debug/netcoreapp1.0.1/Fact.Extensions.Serialization.Tests.dll", "args": ["test", "-debug"], "cwd": "${workspaceRoot}/Fact.Extensions.Serialization.Tests", "externalConsole": false, "stopAtEntry":

Multiple Asserts in a Unit Test [duplicate]

回眸只為那壹抹淺笑 提交于 2019-12-05 14:54:24
问题 This question already has answers here : Is it bad practice to have more than one assertion in a unit test? [closed] (8 answers) Closed 2 years ago . I've just finished reading Roy Osherove's "The Art of Unit Testing" and I am trying to adhere to the best practices he lays out in the book. One of those best practices is to not use multiple asserts in a test method. The reason for this rule is fairly clear to me, but it makes me wonder... If I have a method like: public Foo MakeFoo(int x, int