-
-
Notifications
You must be signed in to change notification settings - Fork 259
Expand file tree
/
Copy pathClientTests.cs
More file actions
71 lines (63 loc) · 2.39 KB
/
ClientTests.cs
File metadata and controls
71 lines (63 loc) · 2.39 KB
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
63
64
65
66
67
68
69
70
71
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Parse.Infrastructure;
namespace Parse.Tests;
[TestClass]
public class ClientTests
{
[TestMethod]
public void TestParseClientConstructor()
{
ParseClient client = new("appId", "https://parse.example.com/", "dotnetKey");
Assert.AreEqual("appId", client.ServerConnectionData.ApplicationID);
Assert.AreEqual("https://parse.example.com/", client.ServerConnectionData.ServerURI);
Assert.AreEqual("dotnetKey", client.ServerConnectionData.Key);
}
[TestMethod]
public void TestParseClientLiveQueryConstructor()
{
ServerConnectionData serverConnectionData = new()
{
ApplicationID = "appId",
ServerURI = "https://parse.example.com/",
Key = "dotnetKey"
};
LiveQueryServerConnectionData liveQueryServerConnectionData = new()
{
ApplicationID = "appId",
ServerURI = "https://parse.example.com/",
Key = "dotnetKey"
};
ParseClient client = new(serverConnectionData, liveQueryServerConnectionData);
Assert.AreEqual("appId", client.ServerConnectionData.ApplicationID);
Assert.AreEqual("https://parse.example.com/", client.ServerConnectionData.ServerURI);
Assert.AreEqual("dotnetKey", client.ServerConnectionData.Key);
Assert.AreEqual("appId", client.LiveQueryServerConnectionData.ApplicationID);
Assert.AreEqual("https://parse.example.com/", client.LiveQueryServerConnectionData.ServerURI);
Assert.AreEqual("dotnetKey", client.LiveQueryServerConnectionData.Key);
}
[TestMethod]
public void TestPublicize()
{
ParseClient previous = ParseClient.Instance;
ParseClient client = new("appId", "https://parse.example.com/", "dotnetKey");
try {
client.Publicize();
Assert.AreSame(client, ParseClient.Instance);
} finally {
previous?.Publicize();
}
}
[TestMethod]
public void TestConstructorWithTestTrue()
{
ServerConnectionData data = new()
{
ApplicationID = "appId",
ServerURI = "https://parse.example.com/",
Key = "key",
Test = true
};
ParseClient client = new(data);
Assert.AreEqual("https://parse.example.com/", client.ServerConnectionData.ServerURI);
}
}