diff --git a/osu.Framework.Tests/Bindables/BindableDictionaryTest.cs b/osu.Framework.Tests/Bindables/BindableDictionaryTest.cs index 0e1204e5f..8b4a53cff 100644 --- a/osu.Framework.Tests/Bindables/BindableDictionaryTest.cs +++ b/osu.Framework.Tests/Bindables/BindableDictionaryTest.cs @@ -785,7 +785,7 @@ namespace osu.Framework.Tests.Bindables Assert.Multiple(() => { Assert.IsNotNull(isDisabled); - Assert.IsTrue(isDisabled.Value); + Assert.IsTrue(isDisabled); }); } @@ -804,11 +804,11 @@ namespace osu.Framework.Tests.Bindables Assert.Multiple(() => { Assert.IsNotNull(isDisabledA); - Assert.IsTrue(isDisabledA.Value); + Assert.IsTrue(isDisabledA); Assert.IsNotNull(isDisabledB); - Assert.IsTrue(isDisabledB.Value); + Assert.IsTrue(isDisabledB); Assert.IsNotNull(isDisabledC); - Assert.IsTrue(isDisabledC.Value); + Assert.IsTrue(isDisabledC); }); } diff --git a/osu.Framework.Tests/Bindables/BindableListTest.cs b/osu.Framework.Tests/Bindables/BindableListTest.cs index 766db27e7..e856d3c00 100644 --- a/osu.Framework.Tests/Bindables/BindableListTest.cs +++ b/osu.Framework.Tests/Bindables/BindableListTest.cs @@ -1247,7 +1247,7 @@ namespace osu.Framework.Tests.Bindables Assert.Multiple(() => { Assert.IsNotNull(isDisabled); - Assert.IsTrue(isDisabled.Value); + Assert.IsTrue(isDisabled); }); } @@ -1266,11 +1266,11 @@ namespace osu.Framework.Tests.Bindables Assert.Multiple(() => { Assert.IsNotNull(isDisabledA); - Assert.IsTrue(isDisabledA.Value); + Assert.IsTrue(isDisabledA); Assert.IsNotNull(isDisabledB); - Assert.IsTrue(isDisabledB.Value); + Assert.IsTrue(isDisabledB); Assert.IsNotNull(isDisabledC); - Assert.IsTrue(isDisabledC.Value); + Assert.IsTrue(isDisabledC); }); } diff --git a/osu.Framework.Tests/Bindables/BindableSerializationTest.cs b/osu.Framework.Tests/Bindables/BindableSerializationTest.cs index 14534c0df..a54854bed 100644 --- a/osu.Framework.Tests/Bindables/BindableSerializationTest.cs +++ b/osu.Framework.Tests/Bindables/BindableSerializationTest.cs @@ -91,8 +91,9 @@ namespace osu.Framework.Tests.Bindables var deserialized = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(toSerialize)); - Assert.AreEqual(toSerialize.Bindable1.Value, deserialized?.Bindable1.Value); - Assert.AreEqual(toSerialize.Bindable2.Value, deserialized?.Bindable2.Value); + Assert.NotNull(deserialized); + Assert.AreEqual(toSerialize.Bindable1.Value, deserialized.Bindable1.Value); + Assert.AreEqual(toSerialize.Bindable2.Value, deserialized.Bindable2.Value); } [Test] @@ -109,8 +110,9 @@ namespace osu.Framework.Tests.Bindables var deserialized = JsonConvert.DeserializeObject>(JsonConvert.SerializeObject(toSerialize)); - Assert.AreEqual(toSerialize.Value.Bindable1.Value, deserialized?.Value.Bindable1.Value); - Assert.AreEqual(toSerialize.Value.Bindable2.Value, deserialized?.Value.Bindable2.Value); + Assert.NotNull(deserialized); + Assert.AreEqual(toSerialize.Value.Bindable1.Value, deserialized.Value.Bindable1.Value); + Assert.AreEqual(toSerialize.Value.Bindable2.Value, deserialized.Value.Bindable2.Value); } [Test] diff --git a/osu.Framework/Graphics/Cursor/ContextMenuContainer.cs b/osu.Framework/Graphics/Cursor/ContextMenuContainer.cs index b711978db..bb8d0f95d 100644 --- a/osu.Framework/Graphics/Cursor/ContextMenuContainer.cs +++ b/osu.Framework/Graphics/Cursor/ContextMenuContainer.cs @@ -108,7 +108,7 @@ namespace osu.Framework.Graphics.Cursor if (menu.State != MenuState.Open || menuTarget == null) return; - if ((menuTarget as Drawable)?.FindClosestParent() != this || (!menuTarget?.IsPresent ?? false)) + if ((menuTarget as Drawable)?.FindClosestParent() != this || !menuTarget.IsPresent) { cancelDisplay(); return; diff --git a/osu.Framework/Platform/GameHost.cs b/osu.Framework/Platform/GameHost.cs index 0fe537f7a..55cdbbb6e 100644 --- a/osu.Framework/Platform/GameHost.cs +++ b/osu.Framework/Platform/GameHost.cs @@ -410,7 +410,7 @@ namespace osu.Framework.Platform Thread.Sleep(1); } - if (response ?? false) + if (response == false) return true; Exit(); diff --git a/osu.Framework/Testing/TestScene.cs b/osu.Framework/Testing/TestScene.cs index bf8e43ee0..2930ab774 100644 --- a/osu.Framework/Testing/TestScene.cs +++ b/osu.Framework/Testing/TestScene.cs @@ -195,7 +195,7 @@ namespace osu.Framework.Testing if (loadableStep != null) { if (actionRepetition == 0) - Logger.Log($"🔸 Step #{actionIndex + 1} {loadableStep?.Text}"); + Logger.Log($"🔸 Step #{actionIndex + 1} {loadableStep.Text}"); scroll.ScrollIntoView(loadableStep); loadableStep.PerformStep();