Bridge.React.Analyser.Test.ComponentTests.ClassesDerivedFromPureComponentMayHaveNonEmptyStaticConstructors C# (CSharp) Метод

ClassesDerivedFromPureComponentMayHaveNonEmptyStaticConstructors() приватный Метод

private ClassesDerivedFromPureComponentMayHaveNonEmptyStaticConstructors ( ) : void
Результат void
		public void ClassesDerivedFromPureComponentMayHaveNonEmptyStaticConstructors()
		{
			var testContent = @"
				using Bridge.React;

				namespace TestCase
				{
					public class LabelComponent : PureComponent<LabelComponent.Props>
					{
						private static readonly int _otherValue;
						static LabelComponent()
						{
							_otherValue = 123;

						}

						public LabelComponent(Props props) : base(props) { }

						public override ReactElement Render()
						{
							return DOM.Label(
								new LabelAttributes { ClassName = props.ClassName },
								props.Text + "" ("" + _otherValue + "")""
							);
						}

						public class Props
						{
							public string ClassName;
							public string Text;
						}
					}
				}";

			VerifyCSharpDiagnostic(testContent);
		}