public void StoreAttributeIfRequiresKeyCurrentValueIsChecked() { var entityLogicalName = "contact"; var attributeLogicalName = "contactid"; var itemCheckEventArgs = new System.Windows.Forms.ItemCheckEventArgs(0, System.Windows.Forms.CheckState.Unchecked, System.Windows.Forms.CheckState.Checked); FluentActions.Invoking(() => systemUnderTest.StoreAttributeIfRequiresKey(attributeLogicalName, itemCheckEventArgs, inputEntityAttributes, entityLogicalName)) .Should() .NotThrow(); inputEntityAttributes.Count.Should().Be(1); inputEntityAttributes[entityLogicalName].Count.Should().Be(0); }
private void ListViewAttributesItemCheck(object sender, ItemCheckEventArgs e) { var indexNumber = e.Index; var logicalName = lvAttributes.Items[indexNumber].SubItems[1].Text; var controller = new AttributeController(); if (entityAttributes.ContainsKey(entityLogicalName)) { controller.StoreAttriubteIfKeyExists(logicalName, e, entityAttributes, entityLogicalName); } else { controller.StoreAttributeIfRequiresKey(logicalName, e, entityAttributes, entityLogicalName); } }