mstest

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

眉间皱痕 提交于 2019-12-07 12:10:37
问题 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

Integration Testing In Visual Studio With Different Project Types

ぃ、小莉子 提交于 2019-12-07 12:03:03
问题 We are in the middle of developing a new CRM, and it uses both WPF for local users, and a Windows Universal App (Store App) for the users in the field. The basic flow is this Customer calls in and gets scheduled on a field user in WPF app. Field user goes on service call and updates on Surface through Universal App. Customer gets billed from the WPF App. All the modules are in place and working, but I do not seem to be able to integration test the entire project flow due to the different

PrivateObject does not find property

北城以北 提交于 2019-12-07 08:43:18
问题 I have a structure which looks basicly like this: abstract class A { protected string Identificator { get; set; } private void DoSomething() { // ... DoSomethingSpecific(); } protected abstract void DoSomethingSpecific(); } Because of the complexity I need do unit tests the DoSomething method to be sure it works allways in the same way. Thats why I created following stub. public class AStub : A { protected override void DoSomethingSpecific() { // nothing to do } } I use the PrivateObject

Visual Studio Code + MSTEST?

独自空忆成欢 提交于 2019-12-07 07:51:01
问题 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"],

TeamCity + MSTest - Run only failed tests?

旧城冷巷雨未停 提交于 2019-12-07 07:27:33
问题 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. 回答1: You can group those

MSTEST - Continuing after an Assert has failed

為{幸葍}努か 提交于 2019-12-07 06:41:42
问题 I am wonder if there is an easy way to finish a test after an Assert has failed. We used to use Galileo for all of our automated tested, but we have moved the Visual Studio Test framework. We had a method that would allow a test to fail, but continue on. public static bool DoAssertAndContinue(Action assert) { try { assert(); return true; } catch (AssertionException ae) { ConfigContext.WriteLine(ae.Message); return false; } } This is what we used before...and it would be called like this:

Best Option for Retrospective application of TDD into C# codebase

白昼怎懂夜的黑 提交于 2019-12-07 06:05:41
问题 I have an existing framework consisting of 5 C# libraries, the framework is well used since 2006 and is the main code base to the majority of my projects. My company wishes to roll out TDD for reasons of software quality; having worked through many tutorials and reading the theory I understand the benefits of TDD. Time is not unlimited I need to make plans for a pragmatic approach to this. From what I know already, the options as I see them are: A) One test project could be used in order to

Test - DeploymentItem - outputDirectory will be ignored

心不动则不痛 提交于 2019-12-07 05:42:27
问题 I use <Deployment> <DeploymentItem filename="TestProject1\Config\" outputDirectory="TestConfig" /><br> </Deployment> in the Local.testsettings to copy all files under TestProject1\Config\ to 'TestRoot'\TestConfig\, but it copies the files direct in the Test 'TestRoot' folder. 回答1: I found out that it work after restarting Visual Studio. A rebuild of the solution or clicking the Refresh button in the TestListEditor will not include a change/setting of the outputDirectory attribute in of

What's the life cycle of Unit Tests in C#

梦想的初衷 提交于 2019-12-07 03:38:53
问题 What's the sequence of events in a full MSTest run of unit tests in C# inside Visual Studio (Ctrl+R, A)? Here's what I think so far: 1 - Runs [AssemblyInitialize] 2 - Randomly runs a [ClassInitialize] 3 - Runs the class [TestInitialize] 4 - Randomly runs a [TestMethod] from that class 5 - Runs the class [TestCleanup] Repeat 3 through 5 for each TestMethod in the class Repeat 2 through 5 for each test class 6 - Runs all classes [ClassCleanup] methods 7 - Runs [AssemblyCleanup] But I think VS

System.InvalidProgramException when executing unit tests in MSTest after Microsoft Security update MS13-004

跟風遠走 提交于 2019-12-07 03:04:11
问题 After applying the Microsoft Security update on the 8th of January 2013 http://technet.microsoft.com/en-us/security/bulletin/ms13-004 we have started to experience failures in our CI builds on our build servers and locally when running tests on our development boxes. We get a System.InvalidProgramException: Common Language Runtime detected an invalid program . This only happens when running tests using MSTest that make use of Castle Windsor DynamicProxy although I am not convinced