Files
sbox-public/engine/Sandbox.Test/Addon/BuiltInTests.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

29 lines
735 B
C#

using System;
namespace Addon
{
[TestClass]
public class BuiltInTests
{
/// <summary>
/// Built-in projects must not have any compile-time warnings.
/// </summary>
[TestMethod]
public async Task NoWarnings()
{
await Project.InitializeBuiltIn( false );
await Project.CompileAsync();
var warnings = Project.All
.Where( x => x.Compiler is not null )
.SelectMany( x => x.Compiler.Diagnostics )
.Where( x => x.Severity > Microsoft.CodeAnalysis.DiagnosticSeverity.Info )
.ToArray();
Assert.AreEqual( 0, warnings.Length,
$"Built-in projects had compile-time warnings.{Environment.NewLine}" +
string.Join( $"{Environment.NewLine} ", warnings.Select( x => x.ToString() ) ) );
}
}
}