-
Notifications
You must be signed in to change notification settings - Fork 48
/
ApiUnitTests.tt
62 lines (55 loc) · 1.97 KB
/
ApiUnitTests.tt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<#@ IntelliSenseLanguage processor="tangibleT4Editor" language="C#" #>
<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Globalization" #>
<#@ include file=".\..\EosSharp.UnitTests.Core\EosTestCasesDef.t4" #>
<#@ output extension=".cs" #>
// Auto Generated, do not edit.
using EosSharp.Core;
using EosSharp.Core.Api.v1;
using EosSharp.Core.Providers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
using System;
using System.Threading.Tasks;
namespace EosSharp.UnitTests
{
[TestClass]
public class ApiUnitTests
{
ApiUnitTestCases ApiUnitTestCases;
public ApiUnitTests()
{
var eosConfig = new EosConfigurator()
{
SignProvider = new DefaultSignProvider("5K57oSZLpfzePvQNpsLS6NfKXLhhRARNU13q6u2ZPQCGHgKLbTA"),
//HttpEndpoint = "https://nodes.eos42.io", //Mainnet
//ChainId = "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906"
//HttpEndpoint = "https://nodeos01.btuga.io",
//ChainId = "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f"
HttpEndpoint = "http://localhost:8888",
ChainId = "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f"
};
var eosApi = new EosApi(eosConfig, new HttpHandler());
ApiUnitTestCases = new ApiUnitTestCases(eosConfig, eosApi);
}
<# foreach (var tc in ApiUnitTestCases) { #>
[TestMethod]
[TestCategory("Api Tests")]
public async Task <#= tc #>()
{
bool success = false;
try
{
await ApiUnitTestCases.<#= tc #>();
success = true;
}
catch (Exception ex)
{
Console.WriteLine(JsonConvert.SerializeObject(ex));
}
Assert.IsTrue(success);
}
<# } #>
}
}