-
Notifications
You must be signed in to change notification settings - Fork 196
/
Copy pathSdkMethodsTests.cs
51 lines (47 loc) · 1.41 KB
/
SdkMethodsTests.cs
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
using System;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Looker.RTL;
using Looker.SDK.API40;
using Xunit;
using Xunit.Abstractions;
namespace sdkrtl.Tests
{
public class SdkMethodsTests
{
private readonly ITestOutputHelper _testOutputHelper;
private TestConfig _config;
private ITransport _transport;
private IAuthSession _auth;
private Looker40SDK sdk;
public SdkMethodsTests(ITestOutputHelper testOutputHelper)
{
_testOutputHelper = testOutputHelper;
_config = new TestConfig();
_transport = new Transport(_config.Settings);
_auth = new AuthSession(_config.Settings, _transport);
sdk = new Looker40SDK(_auth);
}
[Fact]
public async void AllDashboardsTest()
{
var actual = await sdk.Ok(sdk.all_dashboards());
Assert.NotNull(actual);
Assert.True(actual.Length > 0);
var dashes = actual
.Where(d => d.title!.Contains("SDK"))
.Select(x => x)
.ToList();
Assert.True(dashes.Count > 0);
}
[Fact]
public async void MeTest()
{
var actual = await sdk.Ok(sdk.me());
Assert.NotNull(actual);
Assert.NotNull(actual.first_name);
}
}
}