< Summary

Class:MUNity.Models.Resolution.AddAmendment
Assembly:MUNity.Schema
File(s):C:\Users\aeuke\source\repos\PeerConradi\munity\src\MUNitySchema\Models\Resolution\AddAmendment.cs
Covered lines:0
Uncovered lines:13
Coverable lines:13
Total lines:42
Line coverage:0% (0 of 13)
Covered branches:0
Total branches:2
Branch coverage:0% (0 of 2)
Covered methods:0
Total methods:2
Method coverage:0% (0 of 2)

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
Apply(...)0%20%
Deny(...)100%10%

File(s)

C:\Users\aeuke\source\repos\PeerConradi\munity\src\MUNitySchema\Models\Resolution\AddAmendment.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Text;
 4using MUNity.Extensions.ResolutionExtensions;
 5
 6namespace MUNity.Models.Resolution
 7{
 8    /// <summary>
 9    /// An Add Amendment is a type of amendment that is creating a new Operative Paragraph on a given position when accp
 10    /// This logic will create a virtual operative paragraph at the point where the new Amendment will be added when it 
 11    /// </summary>
 12    public class AddAmendment : AbstractAmendment
 13    {
 14        /// <summary>
 15        /// Sets the Virtual Paragraph to a real paragraph and remove the amendment.
 16        /// </summary>
 17        /// <param name="parentSection"></param>
 18        /// <returns></returns>
 19        public override bool Apply(OperativeSection parentSection)
 020        {
 021            var targetParagraph = parentSection.FindOperativeParagraph(this.TargetSectionId);
 022            if (targetParagraph == null)
 023                return false;
 24
 025            targetParagraph.IsVirtual = false;
 026            targetParagraph.Visible = true;
 027            parentSection.AddAmendments.Remove(this);
 028            return true;
 029        }
 30
 31        /// <summary>
 32        /// will delete the amendment and the virtual paragraph.
 33        /// </summary>
 34        /// <param name="parentResolution"></param>
 35        /// <returns></returns>
 36        public override bool Deny(OperativeSection parentResolution)
 037        {
 038            parentResolution.RemoveAmendment(this);
 039            return true;
 040        }
 41    }
 42}

Methods/Properties

Apply(...)
Deny(...)