Skip to content

Commit

Permalink
[DeviceDiscoveryExtension] Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Israel Soto committed Sep 5, 2022
1 parent 2e7eccf commit 4075e88
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
45 changes: 45 additions & 0 deletions tests/monotouch-test/DeviceDiscoveryExtension/DDDeviceTest.cs
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__
1 change: 1 addition & 0 deletions tests/monotouch-test/monotouch-test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@
<Folder Include="WebKit\" />
<Folder Include="NearbyInteraction\" />
<Folder Include="MetricKit\" />
<Folder Include="DeviceDiscoveryExtension\" />
</ItemGroup>
<ItemGroup>
<Content Include="AudioToolbox\1.caf" />
Expand Down

0 comments on commit 4075e88

Please sign in to comment.