< Summary

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

Metrics

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

File(s)

C:\Users\aeuke\source\repos\PeerConradi\munity\src\MUNitySchema\Models\Resolution\ChangeAmendment.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 Amendment to create the Text of an operative paragraph.
 10    /// </summary>
 11    public class ChangeAmendment : AbstractAmendment
 12    {
 13        /// <summary>
 14        /// The Text that the operative Paragraph should be changed to.
 15        /// </summary>
 016        public string NewText { get; set; }
 17
 18        /// <summary>
 19        /// Changes the text and removes the amendment.
 20        /// </summary>
 21        /// <param name="parentSection"></param>
 22        /// <returns></returns>
 23        public override bool Apply(OperativeSection parentSection)
 024        {
 025            parentSection.ChangeAmendments.Remove(this);
 026            var target = parentSection.FindOperativeParagraph(this.TargetSectionId);
 027            if (target == null) return false;
 028            target.Text = this.NewText;
 029            return true;
 030        }
 31
 32        /// <summary>
 33        /// Removes the amendment.
 34        /// </summary>
 35        /// <param name="parentSection"></param>
 36        /// <returns></returns>
 37        public override bool Deny(OperativeSection parentSection)
 038        {
 039            parentSection.ChangeAmendments.Remove(this);
 040            return true;
 041        }
 42    }
 43}

Methods/Properties

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