Resolve inspections

This commit is contained in:
Dan Balasescu
2022-04-14 10:11:54 +09:00
parent 40bd40b920
commit 05e8bfbf27
6 changed files with 17 additions and 15 deletions

View File

@@ -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);
});
}

View File

@@ -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);
});
}

View File

@@ -91,8 +91,9 @@ namespace osu.Framework.Tests.Bindables
var deserialized = JsonConvert.DeserializeObject<CustomObj>(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<Bindable<CustomObj>>(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]

View File

@@ -108,7 +108,7 @@ namespace osu.Framework.Graphics.Cursor
if (menu.State != MenuState.Open || menuTarget == null) return;
if ((menuTarget as Drawable)?.FindClosestParent<ContextMenuContainer>() != this || (!menuTarget?.IsPresent ?? false))
if ((menuTarget as Drawable)?.FindClosestParent<ContextMenuContainer>() != this || !menuTarget.IsPresent)
{
cancelDisplay();
return;

View File

@@ -410,7 +410,7 @@ namespace osu.Framework.Platform
Thread.Sleep(1);
}
if (response ?? false)
if (response == false)
return true;
Exit();

View File

@@ -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();