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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user