Files
sbox-public/engine/Tests/Sandbox.Test.Engine/data/StopwatchPanel.razor.cs
Garry Newman d95169d8fa Unit Test Cleanup (#5064)
* Move all unit tests to Engine/Tests
* Fix Margin.EdgeSubtract
* Fix Capsule.Contains
* EnvironmentVariables.Remove if it's null
* Fixed ray trace never returning startedsolid
* Fix HistoryList.Navigate on empty list
* Fix GameObject.WorldPosition accepting NaNs
* Fix flex: initial expanding to the wrong grow/shrink
* Translation.TryConvert shouldn't throw on invalid enum strings
* Skip sound file tests on machines with no audio device
2026-06-12 13:23:50 +01:00

89 lines
3.6 KiB
C#

#pragma checksum ".\StopwatchPanel.razor" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "363a90f4352dc623de4a3c1b9fd880fc86302381"
// <auto-generated/>
#pragma warning disable 1591
#pragma warning disable 0162
namespace TestComponents
{
#line hidden
#line 2 ".\StopwatchPanel.razor"
using System.Diagnostics;
public partial class StopwatchPanel : global::Sandbox.UI.Panel
{
// Make sure everyone knows that we have a render tree
// (this is an optimization so we have a quick and definite way to check)
protected override string GetRenderTreeChecksum() => "363a90f4352dc623de4a3c1b9fd880fc86302381";
#pragma warning disable 1998
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
{
#line 4 ".\StopwatchPanel.razor"
for ( int i=0; i<10; i++)
{
__builder.AddLocation( ".\\StopwatchPanel.razor", 6, 4 );
__builder.OpenElement( 0, "div", null );
{
#line 6 ".\StopwatchPanel.razor"
__builder.AddAttribute(1, "style", "hello");
#line 7 ".\StopwatchPanel.razor"
for ( int j=0; j< 10; j++)
{
#line 9 ".\StopwatchPanel.razor"
__builder.AddContent(2, i);
__builder.AddContent( 3, " " );
__builder.AddLocation( ".\\StopwatchPanel.razor", 9, 11 );
__builder.OpenElement( 4, "div", null );
{
#line 9 ".\StopwatchPanel.razor"
__builder.AddAttribute(5, "style", "hello");
#line 9 ".\StopwatchPanel.razor"
__builder.AddAttribute( 6, "onclick", Stop );
__builder.AddContent( 7, "poop" );
}
__builder.CloseElement();
#line 10 ".\StopwatchPanel.razor"
}
}
__builder.CloseElement();
#line 11 ".\StopwatchPanel.razor"
}
__builder.AddLocation( ".\\StopwatchPanel.razor", 13, 0 );
__builder.OpenElement( 8, "div", null );
{
#line 13 ".\StopwatchPanel.razor"
__builder.AddAttribute(9, "class", "bigtext");
#line 13 ".\StopwatchPanel.razor"
__builder.AddAttribute( 10, "onclick", Stop );
__builder.AddLocation( ".\\StopwatchPanel.razor", 14, 4 );
__builder.OpenElement( 11, "div", null );
{
#line 14 ".\StopwatchPanel.razor"
__builder.AddAttribute(12, "class", "title" + " " + (Seconds < 5 ? "is-fucked" : "is-relax"));
__builder.AddContent( 13, "The time is " );
#line 14 ".\StopwatchPanel.razor"
__builder.AddContent(14, Formatted);
}
__builder.CloseElement();
__builder.AddLocation( ".\\StopwatchPanel.razor", 14, 93 );
__builder.AddMarkupContent( 15, "\r\n " );
__builder.AddLocation( ".\\StopwatchPanel.razor", 15, 4 );
__builder.AddMarkupContent( 16, "<div class=\"icon\"><i>time</i></div>" );
}
__builder.CloseElement();
}
#pragma warning restore 1998
#line 20 ".\StopwatchPanel.razor"
public string Formatted => sw.Elapsed.ToString();
public float Seconds => (float)sw.Elapsed.TotalSeconds;
Stopwatch sw = Stopwatch.StartNew();
public void Stop()
{
sw.Stop();
}
}
}
#pragma warning restore 0162
#pragma warning restore 1591