-
-
Notifications
You must be signed in to change notification settings - Fork 259
Expand file tree
/
Copy pathLiveQueryEventArgsTests.cs
More file actions
46 lines (39 loc) · 1.27 KB
/
LiveQueryEventArgsTests.cs
File metadata and controls
46 lines (39 loc) · 1.27 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
using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Parse.Abstractions.Platform.Objects;
using Parse.Infrastructure;
using Parse.Platform.LiveQueries;
using Parse.Platform.Objects;
namespace Parse.Tests;
[TestClass]
public class LiveQueryEventArgsTests
{
private ParseClient Client { get; } = new ParseClient(new ServerConnectionData { Test = true });
public LiveQueryEventArgsTests()
{
Client.Publicize();
}
[TestMethod]
public void TestConstructor()
{
IObjectState state = new MutableObjectState
{
ObjectId = "waGiManPutr4Pet1r",
ClassName = "Pagi",
CreatedAt = new DateTime { },
ServerData = new Dictionary<string, object>
{
["username"] = "kevin",
["sessionToken"] = "se551onT0k3n"
}
};
ParseObject obj = Client.GenerateObjectFromState<ParseObject>(state, "Corgi");
ParseLiveQueryEventArgs args = new ParseLiveQueryEventArgs(obj);
// Assert
Assert.AreEqual(obj, args.Object);
}
[TestMethod]
public void TestConstructorException()
=> Assert.ThrowsExactly<ArgumentNullException>(() => new ParseLiveQueryEventArgs(null));
}