-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(GH-168) Fix issue when parsing a single device
Also, more unit tests
- Loading branch information
Showing
4 changed files
with
77 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using Newtonsoft.Json; | ||
using Shouldly; | ||
using Xunit; | ||
using ZoomNet.Models; | ||
|
||
namespace StrongGrid.UnitTests.Resources | ||
{ | ||
public class DashboardParticipantTests | ||
{ | ||
#region FIELDS | ||
|
||
internal const string SINGLE_DASHBOARDPARTICIPANT_JSON = @"{ | ||
'id': 'd52f19c548b88490b5d16fcbd38', | ||
'user_id': '32dsfsd4g5gd', | ||
'user_name': 'dojo', | ||
'device': 'Unknown', | ||
'ip_address': '127.0.0.1', | ||
'location': 'New York', | ||
'network_type': 'Wired', | ||
'microphone': 'Plantronics BT600', | ||
'camera': 'FaceTime HD Camera', | ||
'speaker': 'Plantronics BT600', | ||
'data_center': 'SC', | ||
'full_data_center': 'United States;United States (US03_SC CRC)', | ||
'connection_type': 'P2P', | ||
'join_time': '2019-09-07T13:15:02.837Z', | ||
'leave_time': '2019-09-07T13:15:09.837Z', | ||
'share_application': false, | ||
'share_desktop': true, | ||
'share_whiteboard': true, | ||
'recording': false, | ||
'status': 'in_waiting_room', | ||
'pc_name': 'dojo\'s pc', | ||
'domain': 'Dojo-workspace', | ||
'mac_addr': ' 00:0a:95:9d:68:16', | ||
'harddisk_id': 'sed proident in', | ||
'version': '4.4.55383.0716', | ||
'leave_reason': 'Dojo left the meeting.<br>Reason: Host ended the meeting.', | ||
'sip_uri': 'sip:[email protected]:11029', | ||
'from_sip_uri': 'sip:[email protected]:11029', | ||
'role': 'panelist' | ||
}"; | ||
|
||
#endregion | ||
|
||
[Fact] | ||
public void Parse_json() | ||
{ | ||
// Arrange | ||
|
||
// Act | ||
var result = JsonConvert.DeserializeObject<DashboardParticipant>(SINGLE_DASHBOARDPARTICIPANT_JSON); | ||
|
||
// Assert | ||
result.ShouldNotBeNull(); | ||
result.Devices.ShouldNotBeNull(); | ||
result.Devices.Length.ShouldBe(1); | ||
result.Devices[0].ShouldBe(ParticipantDevice.Unknown); | ||
} | ||
} | ||
} |
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
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
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