Created
January 15, 2016 13:10
-
-
Save makomweb/2418cd37a853f9d60d40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LoginExplorations | |
{ | |
public async Task<DataContracts.List[]> FetchListsAsync(string accessToken, string deviceId) | |
{ | |
var info = new TestSystemInfo( | |
userAgent: "Wunderlist.Sdk/" + new AssemblyInfoHelper(typeof (RestClient)).AssemblyVersion, | |
clientId: "01d4f9dcdafd531da497", | |
clientProductGitHash: new AssemblyInfoHelper(typeof (RestClient)).InformationalVersion, | |
clientDeviceId: deviceId, | |
clientSystem: "Windows RT device", | |
clientPlatform: "WindowsStore", | |
clientProductVersion: "3.0.0", | |
clientSystemVersion: "Windows 10"); | |
var address = string.Format(WunderEnvironment.WebSocketAddressFormat, info.ClientId, info.ClientDeviceId, | |
accessToken); | |
using (var socket = new ReactiveWebSocket {Address = address}) | |
{ | |
var service = new ListsService(new RestSocket(socket, info)); | |
await socket.OpenAsync(); | |
return await service.GetAllAsync(); | |
} | |
} | |
[Test] | |
public async Task Fetching_lists_with_same_access_token_on_another_machine_should_succeed() | |
{ | |
var session = await Signin.WithUser(TestConstants.UserA, TestConstants.DefaultPassword); | |
var machineA = Guid.NewGuid().ToString(); | |
var machineB = Guid.NewGuid().ToString(); | |
var lists = await FetchListsAsync(session.AccessToken, machineA); | |
var lists2 = await FetchListsAsync(session.AccessToken, machineB); | |
Assert.AreEqual(lists.Length, lists2.Length); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment