diff --git a/tests/neo.UnitTests/Network/P2P/UT_RemoteNode.cs b/tests/neo.UnitTests/Network/P2P/UT_RemoteNode.cs index a700902f6c..7b2e083cbb 100644 --- a/tests/neo.UnitTests/Network/P2P/UT_RemoteNode.cs +++ b/tests/neo.UnitTests/Network/P2P/UT_RemoteNode.cs @@ -9,7 +9,6 @@ namespace Neo.UnitTests.Network.P2P { [TestClass] - [NotReRunnable] public class UT_RemoteNode : TestKit { private static NeoSystem testBlockchain; diff --git a/tests/neo.UnitTests/Network/P2P/UT_RemoteNodeMailbox.cs b/tests/neo.UnitTests/Network/P2P/UT_RemoteNodeMailbox.cs index b57e9e93a7..cd566f44f2 100644 --- a/tests/neo.UnitTests/Network/P2P/UT_RemoteNodeMailbox.cs +++ b/tests/neo.UnitTests/Network/P2P/UT_RemoteNodeMailbox.cs @@ -8,7 +8,6 @@ namespace Neo.UnitTests.Network.P2P { [TestClass] - [NotReRunnable] public class UT_RemoteNodeMailbox : TestKit { private static readonly Random TestRandom = new Random(1337); // use fixed seed for guaranteed determinism diff --git a/tests/neo.UnitTests/UT_Culture.cs b/tests/neo.UnitTests/UT_Culture.cs deleted file mode 100644 index a16de9717a..0000000000 --- a/tests/neo.UnitTests/UT_Culture.cs +++ /dev/null @@ -1,108 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Collections; -using System.Globalization; -using System.Linq; -using System.Reflection; - -namespace Neo.UnitTests -{ - [TestClass] - public class UT_Culture - { - // This test runs all the other unit tests in the project, with a variety of cultures - // This test will fail when any other test in the project fails. Fix the other failing test(s) and this test should pass again. - [TestMethod] - [NotReRunnable] - public void All_Tests_Cultures() - { - // get all tests in the unit test project assembly - var testClasses = (from t in typeof(NotReRunnableAttribute).GetTypeInfo().Assembly.DefinedTypes - where t.GetCustomAttribute() != null && t.GetCustomAttribute() == null - select new - { - Constructor = t.GetConstructor(new Type[] { }), - ClassInit = t.GetMethods().Where( - m => m.GetCustomAttribute() != null).SingleOrDefault(), - TestInit = t.GetMethods().Where( - m => m.GetCustomAttribute() != null).SingleOrDefault(), - TestCleanup = t.GetMethods().Where( - m => m.GetCustomAttribute() != null).SingleOrDefault(), - ClassCleanup = t.GetMethods().Where( - m => m.GetCustomAttribute() != null).SingleOrDefault(), - TestMethods = t.GetMethods().Where( - m => m.GetCustomAttribute() != null - && m.GetCustomAttribute() == null).ToList() - }).ToList(); - - var cultures = new string[] { "en-US", "zh-CN", "de-DE", "ko-KR", "ja-JP" }; - var originalUICulture = CultureInfo.CurrentCulture; - var emptyObjArray = new object[] { }; - var testContext = new object[] { new UnitTestContext() }; - - // run all the tests, varying the culture each time. - try - { - foreach (var culture in cultures) - { - CultureInfo.CurrentCulture = new CultureInfo(culture); - - foreach (var c in testClasses) - { - var instance = c.Constructor.Invoke(emptyObjArray); - if (c.ClassInit != null) - { - c.ClassInit.Invoke(instance, testContext); - } - foreach (var m in c.TestMethods) - { - if (c.TestInit != null) - { - c.TestInit.Invoke(instance, emptyObjArray); - } - m.Invoke(instance, emptyObjArray); - if (c.TestCleanup != null) - { - c.TestCleanup.Invoke(instance, emptyObjArray); - } - } - if (c.ClassCleanup != null) - { - c.ClassCleanup.Invoke(instance, emptyObjArray); - } - } - } - } - finally - { - CultureInfo.CurrentCulture = originalUICulture; - } - - } - } - - public class UnitTestContext : TestContext - { - public override IDictionary Properties => throw new NotImplementedException(); - - public override void AddResultFile(string fileName) - { - Console.WriteLine(fileName); - } - - public override void WriteLine(string message) - { - Console.WriteLine(message); - } - - public override void WriteLine(string format, params object[] args) - { - Console.WriteLine(format, args); - } - } - - public class NotReRunnableAttribute : Attribute - { - - } -}