2022-06-06 18:05:38 +03:00
|
|
|
//
|
|
|
|
// Unit tests for HMCharacteristicTest
|
|
|
|
//
|
|
|
|
// Authors:
|
|
|
|
// TJ Lambert <TJ.Lambert@microsoft.com>
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Copyright 2022 Microsoft. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#if HAS_HOMEKIT
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
using Foundation;
|
|
|
|
using HomeKit;
|
|
|
|
using ObjCRuntime;
|
|
|
|
using Xamarin.Utils;
|
|
|
|
|
|
|
|
namespace MonoTouchFixtures.HomeKit
|
|
|
|
{
|
|
|
|
[TestFixture]
|
|
|
|
[Preserve (AllMembers = true)]
|
|
|
|
public class HMCharacteristicTest
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void WriteValueNullTest ()
|
|
|
|
{
|
2022-06-10 00:28:00 +03:00
|
|
|
#if __MACCATALYST__
|
2022-06-09 00:35:31 +03:00
|
|
|
TestRuntime.AssertSystemVersion (ApplePlatform.MacCatalyst, 14,0);
|
2022-06-10 00:28:00 +03:00
|
|
|
#endif
|
2022-06-06 18:05:38 +03:00
|
|
|
var characteristic = new HMCharacteristic ();
|
|
|
|
Assert.Throws<ArgumentNullException> (delegate { characteristic.WriteValue (null, null); }, $"WriteValue should accept a null argument for 'value'.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // HAS_HOMEKIT
|