-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathEventsTest.cs
More file actions
37 lines (34 loc) · 827 Bytes
/
EventsTest.cs
File metadata and controls
37 lines (34 loc) · 827 Bytes
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
using System;
using System.Threading;
using Xunit;
namespace RingCentral.Test
{
[Collection("RestClient collection")]
public class EventsTest : IDisposable
{
private RestClient rc;
public EventsTest(RestClientFixture fixture)
{
rc = fixture.rc;
}
[Fact]
public async void TokenEvent()
{
var temp = 0;
rc.TokenRefreshed += (object sender, TokenEventArgs e) =>
{
temp += 1;
};
await rc.Refresh();
Thread.Sleep(3000);
await rc.Refresh();
Thread.Sleep(3000);
await rc.Refresh();
Assert.Equal(3, temp);
}
public void Dispose()
{
Thread.Sleep(100);
}
}
}