Fix warnings and code cleanup/fixes (#13570)

This commit is contained in:
Visne
2023-01-19 03:56:45 +01:00
committed by GitHub
parent 3ca5a0224b
commit c6d3e4f3bd
265 changed files with 499 additions and 666 deletions

View File

@@ -159,13 +159,13 @@ public sealed class SolutionSystemTests
Assert.That(containerSystem
.TryMixAndOverflow(beaker, solution, oilAdded, threshold, out var overflowingSolution));
Assert.That((FixedPoint2) solution.Volume, Is.EqualTo(FixedPoint2.New(threshold)));
Assert.That(solution.Volume, Is.EqualTo(FixedPoint2.New(threshold)));
solution.TryGetReagent("Water", out var waterMix);
solution.TryGetReagent("Oil", out var oilMix);
Assert.That(waterMix, Is.EqualTo(FixedPoint2.New(threshold / (ratio + 1))));
Assert.That(oilMix, Is.EqualTo(FixedPoint2.New(threshold / (ratio + 1) * ratio)));
Assert.That((FixedPoint2) overflowingSolution.Volume, Is.EqualTo(FixedPoint2.New(80)));
Assert.That(overflowingSolution.Volume, Is.EqualTo(FixedPoint2.New(80)));
overflowingSolution.TryGetReagent("Water", out var waterOverflow);
overflowingSolution.TryGetReagent("Oil", out var oilOverFlow);
Assert.That(waterOverflow, Is.EqualTo(waterQuantity - waterMix));

View File

@@ -32,7 +32,7 @@ namespace Content.IntegrationTests.Tests.Commands
await server.WaitAssertion(() =>
{
Assert.That(configManager.GetCVar<bool>(CCVars.GameLobbyEnabled), Is.EqualTo(false));
Assert.That(configManager.GetCVar(CCVars.GameLobbyEnabled), Is.EqualTo(false));
configManager.SetCVar(CCVars.GameLobbyEnabled, lobbyEnabled);
Assert.That(gameTicker.RunLevel, Is.EqualTo(GameRunLevel.InRound));

View File

@@ -124,7 +124,7 @@ namespace Content.IntegrationTests.Tests.Damageable
await server.WaitAssertion(() =>
{
var uid = (EntityUid) sDamageableEntity;
var uid = sDamageableEntity;
// Check that the correct types are supported.
Assert.That(sDamageableComponent.Damage.DamageDict.ContainsKey(type1.ID), Is.False);

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -28,7 +29,7 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components
.ToList()
.AsParallel()
.Where(filePath => filePath.Extension == "yml" &&
!filePath.Filename.StartsWith("."))
!filePath.Filename.StartsWith(".", StringComparison.Ordinal))
.ToArray();
var cComponentFactory = client.ResolveDependency<IComponentFactory>();

View File

@@ -8,13 +8,12 @@ using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
/// <summary>
/// Materials and stacks have some odd relationships to entities,
/// so we need some test coverage for them.
/// </summary>
namespace Content.IntegrationTests.Tests.Materials
{
/// <summary>
/// Materials and stacks have some odd relationships to entities,
/// so we need some test coverage for them.
/// </summary>
[TestFixture]
[TestOf(typeof(StackSystem))]
[TestOf(typeof(MaterialPrototype))]
@@ -61,7 +60,7 @@ namespace Content.IntegrationTests.Tests.Materials
Assert.That(proto.StackEntity, Is.EqualTo(stackProto.Spawn));
}
});
mapManager.DeleteMap(testMap.MapId);
});
}

View File

@@ -92,7 +92,7 @@ namespace Content.IntegrationTests.Tests
var mapFolder = new ResourcePath("/Maps");
var maps = resourceManager
.ContentFindFiles(mapFolder)
.Where(filePath => filePath.Extension == "yml" && !filePath.Filename.StartsWith("."))
.Where(filePath => filePath.Extension == "yml" && !filePath.Filename.StartsWith(".", StringComparison.Ordinal))
.ToArray();
foreach (var map in maps)
@@ -100,7 +100,7 @@ namespace Content.IntegrationTests.Tests
var rootedPath = map.ToRootedPath();
// ReSharper disable once RedundantLogicalConditionalExpressionOperand
if (SkipTestMaps && rootedPath.ToString().StartsWith(TestMapsPath))
if (SkipTestMaps && rootedPath.ToString().StartsWith(TestMapsPath, StringComparison.Ordinal))
{
continue;
}
@@ -259,7 +259,7 @@ namespace Content.IntegrationTests.Tests
.Where(spawnpoint => spawnpoint.SpawnType == SpawnPointType.Job)
.Select(spawnpoint => spawnpoint.Job.ID)
.Distinct();
List<string> missingSpawnPoints = new() { };
List<string> missingSpawnPoints = new();
foreach (var spawnpoint in jobList.Except(spawnPoints))
{
if (protoManager.Index<JobPrototype>(spawnpoint).SetPreference)
@@ -302,7 +302,7 @@ namespace Content.IntegrationTests.Tests
var mapFolder = new ResourcePath("/Maps");
var maps = resourceManager
.ContentFindFiles(mapFolder)
.Where(filePath => filePath.Extension == "yml" && !filePath.Filename.StartsWith("."))
.Where(filePath => filePath.Extension == "yml" && !filePath.Filename.StartsWith(".", StringComparison.Ordinal))
.ToArray();
var mapNames = new List<string>();
foreach (var map in maps)
@@ -310,7 +310,7 @@ namespace Content.IntegrationTests.Tests
var rootedPath = map.ToRootedPath();
// ReSharper disable once RedundantLogicalConditionalExpressionOperand
if (SkipTestMaps && rootedPath.ToString().StartsWith(TestMapsPath) ||
if (SkipTestMaps && rootedPath.ToString().StartsWith(TestMapsPath, StringComparison.Ordinal) ||
gameMaps.Contains(map))
{
continue;