How to find path of active app.config file?
Try this AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
Try this AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
There are a few ways to do this. Most are covered on this page What I personally would probably do is define a SeleniumContext class and require this class in all my Step class constructors, then tell SpecFlow’s IOC to use the same instance in every scenario: First create the class to hold the selenium … Read more
As far as I know the solution that better suits your needs is to write a pure Python custom rendering using the features exposed by xml.etree.ElementTree. Here is one possible solution: from xml.etree import ElementTree as ET from re import findall, sub def render(root, buffer=””, namespaces=None, level=0, indent_size=2, encoding=’utf-8′): buffer += f'<?xml version=”1.0″ encoding=”{encoding}” ?>\n’ … Read more
In a perfect world, every unit test can only be broken in single way. Every unit test “lives” in isolation to every other. Your addNewFruit test can be broken by breaking isInFruitsList – but luckily, this isn’t a perfect world either. Since you already tested isInFruitsList method, you shouldn’t worry about that. That’s like using … Read more
As of today (7/2/2014) async testing is supported by: xUnit: with async methods that return a Task (since 1.9) MSTest: with async methods that return a Task (since VS 2012) NUnit: with async methods that return a Task, or even, that return void, since 2.6.2. Since 3.0 th option to return void is not supported, … Read more
Using JUnit 4.4 you can use assertThat() together with the Hamcrest code (don’t worry, it’s shipped with JUnit, no need for an extra .jar) to produce complex self-describing asserts including ones that operate on collections: import static org.junit.Assert.assertThat; import static org.junit.matchers.JUnitMatchers.*; import static org.hamcrest.CoreMatchers.*; List<String> l = Arrays.asList(“foo”, “bar”); assertThat(l, hasItems(“foo”, “bar”)); assertThat(l, not(hasItem((String) null))); … Read more
If you’re using a NUnit3+ version, there is a new Test Adapter available. Go to “Tools -> Extensions and Updates -> Online” and search for “NUnit3 Test Adapter” and then install.
The correct way to escape double-quotes in VB is by doubling the double-quotes: <TestCase(“FirstNode”, “<node id=””FirstNode””>”)>
Implement the SetEntryAssembly(Assembly assembly) method given in http://frostwave.googlecode.com/svn-history/r75/trunk/F2DUnitTests/Code/AssemblyUtilities.cs to your unit test project. /// <summary> /// Use as first line in ad hoc tests (needed by XNA specifically) /// </summary> public static void SetEntryAssembly() { SetEntryAssembly(Assembly.GetCallingAssembly()); } /// <summary> /// Allows setting the Entry Assembly when needed. /// Use AssemblyUtilities.SetEntryAssembly() as first line in XNA … Read more