diff --git a/Dalamud.Test/Compliance/PublicApiTests.cs b/Dalamud.Test/Compliance/PublicApiTests.cs index 4e51bb932..2edf44be2 100644 --- a/Dalamud.Test/Compliance/PublicApiTests.cs +++ b/Dalamud.Test/Compliance/PublicApiTests.cs @@ -5,19 +5,12 @@ using System.Reflection; using Dalamud.Utility; using Xunit; -using Xunit.Abstractions; namespace Dalamud.Test.Compliance; public class PublicApiTests { - private readonly ITestOutputHelper testOutputHelper; - public PublicApiTests(ITestOutputHelper testOutputHelper) - { - this.testOutputHelper = testOutputHelper; - } - [Fact] public void NoClientStructsTypes() { @@ -29,46 +22,49 @@ public class PublicApiTests { if (t.GetCustomAttribute() != null) continue; - var methods = t.GetMethods().Where(m => m.IsPublic && !m.IsSpecialName); - - foreach (var m in methods) + foreach (var m in t.GetMethods().Where(m => m.IsPublic && !m.IsSpecialName)) { - if (m.GetCustomAttribute() != null || m.GetCustomAttribute() != null) continue; - if (m.IsPrivate) continue; + if (m.GetCustomAttribute() != null || + m.GetCustomAttribute() != null) continue; if (m.ReturnType.Assembly == clientStructsAssembly) { - Assert.Fail($"Method {t.FullName}.{m.Name} returns a type from FFXIVClientStructs: {m.ReturnType.FullName}"); + Assert.Fail( + $"Method {t.FullName}.{m.Name} returns a type from FFXIVClientStructs: {m.ReturnType.FullName}"); } foreach (var param in m.GetParameters()) { if (param.ParameterType.Assembly == clientStructsAssembly) { - Assert.Fail($"Method {t.FullName}.{m.Name} has a parameter from FFXIVClientStructs: {param.ParameterType.FullName}"); + Assert.Fail( + $"Method {t.FullName}.{m.Name} has a parameter from FFXIVClientStructs: {param.ParameterType.FullName}"); } } } foreach (var p in t.GetProperties()) { - if (p.GetCustomAttribute() != null || p.GetCustomAttribute() != null) continue; + if (p.GetCustomAttribute() != null || + p.GetCustomAttribute() != null) continue; if (p.GetMethod?.IsPrivate == true && p.SetMethod?.IsPrivate == true) continue; if (p.PropertyType.Assembly == clientStructsAssembly) { - Assert.Fail($"Property {t.FullName}.{p.Name} is a type from FFXIVClientStructs: {p.PropertyType.FullName}"); + Assert.Fail( + $"Property {t.FullName}.{p.Name} is a type from FFXIVClientStructs: {p.PropertyType.FullName}"); } } - foreach (var field in t.GetFields()) + foreach (var f in t.GetFields().Where(f => f.IsPublic && !f.IsSpecialName)) { - if (field.GetCustomAttribute() != null || field.GetCustomAttribute() != null) continue; - if (field.IsPrivate) continue; + if (f.GetCustomAttribute() != null || + f.GetCustomAttribute() != null) continue; - if (field.FieldType.Assembly == clientStructsAssembly) + if (f.FieldType.Assembly == clientStructsAssembly) { - Assert.Fail($"Field {t.FullName}.{field.Name} is of a type from FFXIVClientStructs: {field.FieldType.FullName}"); + Assert.Fail( + $"Field {t.FullName}.{f.Name} is of a type from FFXIVClientStructs: {f.FieldType.FullName}"); } } }