static void Main(string[] args) { if (args.Length > 0) { RunHelper.StartTimedTestRun(suite => { var loader = new TestLoader(); foreach (var arg in args) { Debug.WriteLine(arg); if (Directory.Exists(arg)) { suite.Add(loader.LoadFromDirectory(arg)); } else if (File.Exists(arg)) { suite.Add(loader.LoadFromFile(arg)); } } }); } else { Console.WriteLine("No arguments."); } }
private static IEnumerable <TrieTest> LoadAnyOrderSecureTests() { IEnumerable <TrieTest> tests = TestLoader.LoadFromFile <Dictionary <string, TrieTestJson>, TrieTest>( "trieanyorder_secureTrie.json", dwj => dwj.Select(p => new TrieTest(p.Key, p.Value.In.ToList(), p.Value.Root))); return(GetTestPermutations(tests)); }
private static IEnumerable <TrieTest> LoadHexEncodedSecureTests() { IEnumerable <TrieTest> tests = TestLoader.LoadFromFile <Dictionary <string, TrieTestJson>, TrieTest>( "hex_encoded_securetrie_test.json", dwj => dwj.Select(p => new TrieTest(p.Key, p.Value.In.ToList(), p.Value.Root))); return(GetTestPermutations(tests)); }
private static IEnumerable <AbiTest> LoadBasicAbiTests() { IEnumerable <AbiTest> tests = TestLoader.LoadFromFile <Dictionary <string, AbiTestJson>, AbiTest>( "basic_abi_tests.json", allTests => allTests.Select(namedTest => Convert(namedTest.Key, namedTest.Value))); return(tests); }
public static IEnumerable <DifficultyTests> LoadHex(string fileName) { Stopwatch watch = new Stopwatch(); IEnumerable <DifficultyTests> tests = TestLoader.LoadFromFile <Dictionary <string, DifficultyTestHexJson>, DifficultyTests>( fileName, t => t.Select(dtj => ToTest(fileName, dtj.Key, dtj.Value))).ToList(); watch.Stop(); return(tests); }
public void testLoadFromFileAbsolute() { // Arrange TestSuite suite = null; TestLoader loader = new TestLoader(); string file = System.IO.Path.GetFullPath(@"..\..\..\TestLoaderTestTests\bin\Debug\TestLoaderTestTests.dll"); // Act suite = loader.LoadFromFile(file); // Assert Assert.AreEqual(1, suite.Tests.Count); }
public static IEnumerable <DifficultyTests> Load(string fileName) { return(TestLoader.LoadFromFile <Dictionary <string, DifficultyTestJson>, DifficultyTests>( fileName, t => t.Select(dtj => ToTest(fileName, dtj.Key, dtj.Value)))); }
public static IEnumerable <TransactionTest> LoadTests() { return(TestLoader.LoadFromFile <TransactionTestJson[], TransactionTest>( "txtest.json", jsonArray => jsonArray.Select(Convert))); }
private static IEnumerable <KeyAddressTest> LoadTests() { return(TestLoader.LoadFromFile <KeyAddressTestJson[], KeyAddressTest>( "keyaddrtest.json", c => c.Select(FromJson))); }
public void testLoadFromFileFail() { // Arrange TestSuite suite = null; TestLoader loader = new TestLoader(); string file = "x"; try { // Act suite = loader.LoadFromFile(file); Assert.Fail(); } catch (ArgumentException actual) { // Assert Assert.AreEqual("File does not exist\r\nParameter name: file", actual.Message); } }
public void testLoadFromFileRelative() { // Arrange TestSuite suite = null; TestLoader loader = new TestLoader(); string file = @"..\..\..\TestLoaderTestTests\bin\Debug\TestLoaderTestTests.dll"; // Act suite = loader.LoadFromFile(file); // Assert Assert.AreEqual(1, suite.Tests.Count); }
private static IEnumerable <EthashTest> LoadTests() { return(TestLoader.LoadFromFile <Dictionary <string, EthashTestJson>, EthashTest>( "keyaddrtest.json", c => c.Select(p => Convert(p.Key, p.Value)))); }
private static IEnumerable <TrieTest> LoadSecureTests() { return(TestLoader.LoadFromFile <Dictionary <string, TrieTestArraysJson>, TrieTest>( "trietest_secureTrie.json", dwj => dwj.Select(Convert))); }
private static IEnumerable <RlpTest> LoadTests(string testFileName) { return(TestLoader.LoadFromFile <Dictionary <string, RlpTestJson>, RlpTest>( testFileName, c => c.Select(p => new RlpTest(p.Key, p.Value.In, p.Value.Out)))); }
// ReSharper disable once MemberCanBePrivate.Global // used as a test case source, hasbe public public static IEnumerable <HexPrefixTest> LoadTests() { return(TestLoader.LoadFromFile <Dictionary <string, HexPrefixTestJson>, HexPrefixTest>( "hexencodetest.json", c => c.Select(p => new HexPrefixTest(p.Key, p.Value.Seq, p.Value.Term, p.Value.Out)))); }