Last active
August 29, 2015 14:12
-
-
Save polarnik/d3f55cdd2a71679f386b to your computer and use it in GitHub Desktop.
Перезапуск модульного теста, второй шанс.Visual Studio, C#, test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Перезапуск модульного теста, второй шанс. Visual Studio, C#, test. | |
// Автор: Алексей Пантюхин, 29.12.2014. | |
// Для перезапуска модульных тестов на Selenium, которые упали из-за зависаний браузера. | |
[TestCleanup] | |
public void StopTest() | |
{ | |
if (TestContext.CurrentTestOutcome != UnitTestOutcome.Passed) | |
{ | |
ConstructorInfo objConst = this.GetType().GetConstructor(Type.EmptyTypes); | |
object objMass = objConst.Invoke(new object[]{}); | |
MethodInfo TestInfo = this.GetType().GetMethod(TestContext.TestName.ToString()); | |
TestInfo.Invoke(objMass, new object[]{}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment