public void SetAssemblyGroupStyle_DataGridViewColumnStateDefinitionNull_ThrowsArgumentNullException()
        {
            // Call
            void Call() => FailureMechanismSectionResultRowHelper.SetAssemblyGroupStyle(
                null, new Random(39).NextEnumValue <FailureMechanismSectionAssemblyGroup>());

            // Assert
            var exception = Assert.Throws <ArgumentNullException>(Call);

            Assert.AreEqual("columnStateDefinition", exception.ParamName);
        }
        public void SetAssemblyGroupStyle_ValidFailureMechanismSectionAssemblyGroup_UpdatesColumnStyle(
            FailureMechanismSectionAssemblyGroup assemblyGroup, Color expectedColor)
        {
            // Setup
            var columnStateDefinition = new DataGridViewColumnStateDefinition();

            // Call
            FailureMechanismSectionResultRowHelper.SetAssemblyGroupStyle(columnStateDefinition, assemblyGroup);

            // Assert
            Assert.AreEqual(expectedColor, columnStateDefinition.Style.BackgroundColor);
            Assert.AreEqual(Color.FromKnownColor(KnownColor.ControlText), columnStateDefinition.Style.TextColor);
        }
        public void SetAssemblyGroupStyle_InvalidFailureMechanismSectionAssemblyGroup_ThrowsInvalidEnumArgumentException()
        {
            // Setup
            var columnStateDefinition = new DataGridViewColumnStateDefinition();
            const FailureMechanismSectionAssemblyGroup assemblyGroup = (FailureMechanismSectionAssemblyGroup)99;

            // Call
            void Call() => FailureMechanismSectionResultRowHelper.SetAssemblyGroupStyle(columnStateDefinition, assemblyGroup);

            // Assert
            var expectedMessage = $"The value of argument 'assemblyGroup' ({assemblyGroup}) is invalid for Enum type '{nameof(FailureMechanismSectionAssemblyGroup)}'.";

            TestHelper.AssertThrowsArgumentExceptionAndTestMessage <InvalidEnumArgumentException>(Call, expectedMessage);
        }