Files
sbox-public/engine/Sandbox.Test/Bind/FindAttributes.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
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 );
}
}