From 3cf2446e25c142092ca2dc3acbed4c40004a9db8 Mon Sep 17 00:00:00 2001 From: nirinchev Date: Fri, 23 Aug 2024 15:46:35 +0300 Subject: [PATCH] Fix a warning and Unity build --- Realm/Realm/Logging/Logger.cs | 2 ++ Tests/Realm.Tests/Sync/DataTypeSynchronizationTests.cs | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Realm/Realm/Logging/Logger.cs b/Realm/Realm/Logging/Logger.cs index da28f9a331..de3d7648e5 100644 --- a/Realm/Realm/Logging/Logger.cs +++ b/Realm/Realm/Logging/Logger.cs @@ -18,6 +18,7 @@ using System; using System.Collections.Concurrent; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.Text; using System.Threading; @@ -49,6 +50,7 @@ protected override void LogImpl(LogLevel level, LogCategory category, string mes /// A few built-in implementations are provided by , , and , /// but you can implement your own. /// + [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Original logger is deprecated")] public abstract class RealmLogger { private readonly Lazy _gcHandle; diff --git a/Tests/Realm.Tests/Sync/DataTypeSynchronizationTests.cs b/Tests/Realm.Tests/Sync/DataTypeSynchronizationTests.cs index 310af261d8..bb7418e6d9 100644 --- a/Tests/Realm.Tests/Sync/DataTypeSynchronizationTests.cs +++ b/Tests/Realm.Tests/Sync/DataTypeSynchronizationTests.cs @@ -902,14 +902,15 @@ public void NestedCollections_Merge() var list2 = obj1.RealmValueProperty.AsDictionary()["list"].AsList(); var dictionary2 = obj1.RealmValueProperty.AsDictionary()["dictionary"].AsDictionary(); - Assert.That(list1, Does.Not.Contain((RealmValue)1)); + Assert.That(list1, Does.Not.Contains((RealmValue)1)); Assert.That(list1, Contains.Item((RealmValue)2)); Assert.That(list1, Contains.Item((RealmValue)3)); Assert.That(list1, Contains.Item((RealmValue)4)); Assert.That(list1, Contains.Item((RealmValue)5)); Assert.That(list1, Is.EqualTo(list2).Using(_rvComparer)); - Assert.That(dictionary1, Does.Not.ContainKey("key1")); + // Unity Nunit doesn't support Does.Not.ContainKey, so use a more simplistic expression here + Assert.That(dictionary1.ContainsKey("key1"), Is.False); Assert.That(dictionary1, Contains.Key("key2")); Assert.That(dictionary1, Contains.Key("key3")); Assert.That(dictionary1, Is.EqualTo(dictionary2).Using(_rvComparer));