Remove nullable disable annotation in the test case.

This commit is contained in:
andy840119
2022-10-30 16:36:22 +08:00
parent 4c9c65856c
commit 6ce3841686
13 changed files with 23 additions and 50 deletions

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using Moq; using Moq;
@ -20,8 +18,8 @@ namespace osu.Game.Tests.Editing.Checks
[TestFixture] [TestFixture]
public class CheckAudioInVideoTest public class CheckAudioInVideoTest
{ {
private CheckAudioInVideo check; private CheckAudioInVideo check = null!;
private IBeatmap beatmap; private IBeatmap beatmap = null!;
[SetUp] [SetUp]
public void Setup() public void Setup()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Linq; using System.Linq;
using Moq; using Moq;
using NUnit.Framework; using NUnit.Framework;
@ -19,8 +17,8 @@ namespace osu.Game.Tests.Editing.Checks
[TestFixture] [TestFixture]
public class CheckAudioQualityTest public class CheckAudioQualityTest
{ {
private CheckAudioQuality check; private CheckAudioQuality check = null!;
private IBeatmap beatmap; private IBeatmap beatmap = null!;
[SetUp] [SetUp]
public void Setup() public void Setup()

View File

@ -1,12 +1,9 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using JetBrains.Annotations;
using Moq; using Moq;
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Graphics.Rendering.Dummy; using osu.Framework.Graphics.Rendering.Dummy;
@ -21,8 +18,8 @@ namespace osu.Game.Tests.Editing.Checks
[TestFixture] [TestFixture]
public class CheckBackgroundQualityTest public class CheckBackgroundQualityTest
{ {
private CheckBackgroundQuality check; private CheckBackgroundQuality check = null!;
private IBeatmap beatmap; private IBeatmap beatmap = null!;
[SetUp] [SetUp]
public void Setup() public void Setup()
@ -118,7 +115,7 @@ namespace osu.Game.Tests.Editing.Checks
stream.Verify(x => x.Close(), Times.Once()); stream.Verify(x => x.Close(), Times.Once());
} }
private BeatmapVerifierContext getContext(Texture background, [CanBeNull] Stream stream = null) private BeatmapVerifierContext getContext(Texture background, Stream? stream = null)
{ {
return new BeatmapVerifierContext(beatmap, getMockWorkingBeatmap(background, stream).Object); return new BeatmapVerifierContext(beatmap, getMockWorkingBeatmap(background, stream).Object);
} }
@ -128,7 +125,7 @@ namespace osu.Game.Tests.Editing.Checks
/// </summary> /// </summary>
/// <param name="background">The texture of the background.</param> /// <param name="background">The texture of the background.</param>
/// <param name="stream">The stream representing the background file.</param> /// <param name="stream">The stream representing the background file.</param>
private Mock<IWorkingBeatmap> getMockWorkingBeatmap(Texture background, [CanBeNull] Stream stream = null) private Mock<IWorkingBeatmap> getMockWorkingBeatmap(Texture background, Stream? stream = null)
{ {
stream ??= new MemoryStream(new byte[1024 * 1024]); stream ??= new MemoryStream(new byte[1024 * 1024]);

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Moq; using Moq;
@ -21,7 +19,7 @@ namespace osu.Game.Tests.Editing.Checks
[TestFixture] [TestFixture]
public class CheckConcurrentObjectsTest public class CheckConcurrentObjectsTest
{ {
private CheckConcurrentObjects check; private CheckConcurrentObjects check = null!;
[SetUp] [SetUp]
public void Setup() public void Setup()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NUnit.Framework; using NUnit.Framework;
@ -20,10 +18,10 @@ namespace osu.Game.Tests.Editing.Checks
[TestFixture] [TestFixture]
public class CheckFewHitsoundsTest public class CheckFewHitsoundsTest
{ {
private CheckFewHitsounds check; private CheckFewHitsounds check = null!;
private List<HitSampleInfo> notHitsounded; private List<HitSampleInfo> notHitsounded = null!;
private List<HitSampleInfo> hitsounded; private List<HitSampleInfo> hitsounded = null!;
[SetUp] [SetUp]
public void Setup() public void Setup()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Linq; using System.Linq;
using NUnit.Framework; using NUnit.Framework;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
@ -16,8 +14,8 @@ namespace osu.Game.Tests.Editing.Checks
[TestFixture] [TestFixture]
public class CheckFilePresenceTest public class CheckFilePresenceTest
{ {
private CheckBackgroundPresence check; private CheckBackgroundPresence check = null!;
private IBeatmap beatmap; private IBeatmap beatmap = null!;
[SetUp] [SetUp]
public void Setup() public void Setup()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using NUnit.Framework; using NUnit.Framework;
@ -21,8 +19,8 @@ namespace osu.Game.Tests.Editing.Checks
[TestFixture] [TestFixture]
public class CheckMutedObjectsTest public class CheckMutedObjectsTest
{ {
private CheckMutedObjects check; private CheckMutedObjects check = null!;
private ControlPointInfo cpi; private ControlPointInfo cpi = null!;
private const int volume_regular = 50; private const int volume_regular = 50;
private const int volume_low = 15; private const int volume_low = 15;

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Game.Models; using osu.Game.Models;
namespace osu.Game.Tests.Editing.Checks namespace osu.Game.Tests.Editing.Checks

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -22,8 +20,8 @@ namespace osu.Game.Tests.Editing.Checks
[TestFixture] [TestFixture]
public class CheckTooShortAudioFilesTest public class CheckTooShortAudioFilesTest
{ {
private CheckTooShortAudioFiles check; private CheckTooShortAudioFiles check = null!;
private IBeatmap beatmap; private IBeatmap beatmap = null!;
[SetUp] [SetUp]
public void Setup() public void Setup()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Moq; using Moq;
@ -21,8 +19,8 @@ namespace osu.Game.Tests.Editing.Checks
[TestFixture] [TestFixture]
public class CheckUnsnappedObjectsTest public class CheckUnsnappedObjectsTest
{ {
private CheckUnsnappedObjects check; private CheckUnsnappedObjects check = null!;
private ControlPointInfo cpi; private ControlPointInfo cpi = null!;
[SetUp] [SetUp]
public void Setup() public void Setup()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using Moq; using Moq;
@ -17,8 +15,8 @@ namespace osu.Game.Tests.Editing.Checks
[TestFixture] [TestFixture]
public class CheckZeroByteFilesTest public class CheckZeroByteFilesTest
{ {
private CheckZeroByteFiles check; private CheckZeroByteFiles check = null!;
private IBeatmap beatmap; private IBeatmap beatmap = null!;
[SetUp] [SetUp]
public void Setup() public void Setup()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Moq; using Moq;
@ -21,7 +19,7 @@ namespace osu.Game.Tests.Editing.Checks
[TestFixture] [TestFixture]
public class CheckZeroLengthObjectsTest public class CheckZeroLengthObjectsTest
{ {
private CheckZeroLengthObjects check; private CheckZeroLengthObjects check = null!;
[SetUp] [SetUp]
public void Setup() public void Setup()

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using System.Threading;
using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects;