-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DeviceDiscoveryExtension] Added tests
- Loading branch information
Israel Soto
committed
Sep 5, 2022
1 parent
2e7eccf
commit 4075e88
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
tests/monotouch-test/DeviceDiscoveryExtension/DDDeviceTest.cs
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,45 @@ | ||
// | ||
// Unit tests for DDDevice | ||
// | ||
// Authors: | ||
// Israel Soto <issoto@microsoft.com> | ||
// | ||
// Copyright 2022 Microsoft Corporation. | ||
// | ||
|
||
#nullable enable | ||
|
||
#if __IOS__ | ||
|
||
using System; | ||
using DeviceDiscoveryExtension; | ||
using Foundation; | ||
using Network; | ||
using ObjCRuntime; | ||
using UniformTypeIdentifiers; | ||
using NUnit.Framework; | ||
|
||
namespace MonoTouchFixtures.DeviceDiscoveryExtension { | ||
|
||
[TestFixture] | ||
[Preserve (AllMembers = true)] | ||
public class DDDeviceTest { | ||
|
||
[Test] | ||
public void NetworkEndpointTest () | ||
{ | ||
TestRuntime.AssertXcodeVersion (14,0); | ||
|
||
var uuid = Guid.NewGuid (); | ||
var endpoint = NWEndpoint.Create ("www.microsoft.com", "https"); | ||
var device = new DDDevice ("MyDevice", DDDeviceCategory.LaptopComputer, UTType.CreateFromIdentifier ("com.adobe.pdf"), uuid.ToString ()); | ||
|
||
device.NetworkEndpoint = endpoint; | ||
var tmpEndpoint = device.NetworkEndpoint; | ||
|
||
Assert.True (endpoint.GetHandle () == tmpEndpoint.GetHandle (), "NetworkEndpoint"); | ||
} | ||
} | ||
} | ||
|
||
#endif // __IOS__ |
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