Fix content test warnings (#9865)

* Fix content test warnings

* while I'm here

* fix

Co-authored-by: wrexbe <wrexbe@protonmail.com>
This commit is contained in:
metalgearsloth
2022-07-20 14:48:44 +10:00
committed by GitHub
parent 7e21b55781
commit b7623b6c08
6 changed files with 36 additions and 38 deletions

View File

@@ -146,9 +146,10 @@ namespace Content.IntegrationTests.Tests
foreach (var type in componentFactory.AllRegisteredTypes)
{
var component = (Component) componentFactory.GetComponent(type);
var name = componentFactory.GetComponentName(type);
// If this component is ignored
if (skipComponents.Contains(component.Name))
if (skipComponents.Contains(name))
{
continue;
}
@@ -166,13 +167,13 @@ namespace Content.IntegrationTests.Tests
component.Owner = entity;
Logger.LogS(LogLevel.Debug, "EntityTest", $"Adding component: {component.Name}");
Logger.LogS(LogLevel.Debug, "EntityTest", $"Adding component: {name}");
Assert.DoesNotThrow(() =>
{
entityManager.AddComponent(entity, component);
}, "Component '{0}' threw an exception.",
component.Name);
name);
entityManager.DeleteEntity(entity);
}
@@ -282,15 +283,14 @@ namespace Content.IntegrationTests.Tests
continue;
}
var name = componentFactory.GetComponentName(component.GetType());
// If this component is ignored
if (skipComponents.Contains(component.Name))
{
if (skipComponents.Contains(name))
continue;
}
component.Owner = entity;
Logger.LogS(LogLevel.Debug, "EntityTest", $"Adding component: {component.Name}");
Logger.LogS(LogLevel.Debug, "EntityTest", $"Adding component: {name}");
// Note for the future coder: if an exception occurs where a component reference
// was already occupied it might be because some component is ensuring another // initialize.
@@ -300,7 +300,7 @@ namespace Content.IntegrationTests.Tests
{
entityManager.AddComponent(entity, component);
}, "Component '{0}' threw an exception.",
component.Name);
name);
}
entityManager.DeleteEntity(entity);
}