Files
sbox-public/engine/Sandbox.Test.Unit/Bind/FindAttributes.cs
Lorenz Junglas 91f8fcf183 Speed up / parallelize tests (#3587)
- Added Sandbox.Test.Unit project (contains independent tests that can run in parallel) 
- Modify some slow/stress tests (e.g. instead of doing a million iterations settle for 10k).

Tests run almost twice as fast now.
2025-12-10 14:23:00 +01:00

29 lines
613 B
C#

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.ComponentModel.DataAnnotations;
namespace TestBind;
[TestClass]
public class FindAttributes
{
public string Primary { get; set; }
[Display( Name = "Fuck" )]
public string Secondary { get; set; }
[TestMethod]
public void Simple()
{
Primary = "Dog";
Secondary = "Cat";
var bind = new Sandbox.Bind.BindSystem( "test" );
bind.Build.Set( this, "Primary" ).From( this, "Secondary" );
var attributes = bind.FindAttributes( this, nameof( Primary ) );
Assert.IsNotNull( attributes );
Assert.AreEqual( 1, attributes.Length );
}
}