From 7abf6f86852e522d6595c44f87c34fc617f15576 Mon Sep 17 00:00:00 2001 From: Owen Smith Date: Fri, 9 Apr 2021 10:21:49 -0400 Subject: [PATCH] add test for parenthesized assignment Ref: https://github.com/Brightspace/D2L.CodeStyle/issues/738 --- .../Specs/ImmutabilityAnalyzer.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/D2L.CodeStyle.Analyzers.Test/Specs/ImmutabilityAnalyzer.cs b/tests/D2L.CodeStyle.Analyzers.Test/Specs/ImmutabilityAnalyzer.cs index 0c4a2324..9398d58a 100644 --- a/tests/D2L.CodeStyle.Analyzers.Test/Specs/ImmutabilityAnalyzer.cs +++ b/tests/D2L.CodeStyle.Analyzers.Test/Specs/ImmutabilityAnalyzer.cs @@ -113,6 +113,15 @@ public SomeClassWithConstructor7( U you ) { Tee = you; } } + + [Immutable] + public sealed class SomeClassWithConstructor8 { + public readonly RegularInterface m_interface = new Good(); + + public SomeClassWithConstructor8() { + (m_interface) = /* NonImmutableTypeHeldByImmutable(class, SpecTests.Types.Bad, (or [ImmutableBaseClass])) */ new Bad() /**/; + } + } #endregion