mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-23 03:39:35 -10:00
Commit migrated from https://github.com/dotnet/corefx/commit/8c429df8ac762b211df4c1268e9c80cb614ca7a1
55 lines
1.4 KiB
C#
55 lines
1.4 KiB
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using Xunit;
|
|
|
|
namespace System.CodeDom.Tests
|
|
{
|
|
public class CodeGotoStatementTests : CodeStatementTestBase<CodeGotoStatement>
|
|
{
|
|
[Fact]
|
|
public void Ctor_Default()
|
|
{
|
|
var gotoStatement = new CodeGotoStatement();
|
|
Assert.Null(gotoStatement.Label);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("\r n \t")]
|
|
[InlineData("Label")]
|
|
public void Ctor_String(string label)
|
|
{
|
|
var gotoStatement = new CodeGotoStatement(label);
|
|
Assert.Equal(label, gotoStatement.Label);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData(null)]
|
|
[InlineData("")]
|
|
public void Ctor_StringNullOrEmpty_ThrowsArgumentNullException(string value)
|
|
{
|
|
Assert.Throws<ArgumentNullException>("value", () => new CodeGotoStatement(value));
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("\r \n \t")]
|
|
[InlineData("Label")]
|
|
public void Label_Set_Get_ReturnsExpected(string value)
|
|
{
|
|
var gotoStatement = new CodeGotoStatement();
|
|
gotoStatement.Label = value;
|
|
Assert.Equal(value, gotoStatement.Label);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData(null)]
|
|
[InlineData("")]
|
|
public void Label_SetNullOrEmpty_ThrowsArgumentNullException(string value)
|
|
{
|
|
var gotoStatement = new CodeGotoStatement();
|
|
Assert.Throws<ArgumentNullException>("value", () => gotoStatement.Label = value);
|
|
}
|
|
}
|
|
}
|