Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@makomweb
Created January 15, 2016 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makomweb/2418cd37a853f9d60d40 to your computer and use it in GitHub Desktop.
Save makomweb/2418cd37a853f9d60d40 to your computer and use it in GitHub Desktop.
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