mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-16 10:19:18 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
29 lines
613 B
C#
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 );
|
|
}
|
|
|
|
}
|