Example #1
0
        public void TestIdsAreDifferent()
        {
            var amendmentOne = new AddAmendment();
            var amendmentTwo = new AddAmendment();

            Assert.IsFalse(amendmentOne.Id == amendmentTwo.Id);
        }
Example #2
0
    public static AddAmendment ToModel(this ResaAddAmendment sourceAmendment)
    {
        var model = new AddAmendment()
        {
            Activated       = sourceAmendment.Activated,
            Id              = sourceAmendment.ResaAmendmentId,
            Name            = sourceAmendment.GetType().Name,
            SubmitterName   = sourceAmendment.SubmitterName,
            SubmitTime      = sourceAmendment.SubmitTime,
            TargetSectionId = sourceAmendment.VirtualParagraph.ResaOperativeParagraphId,
            Type            = "add"
        };

        return(model);
    }
Example #3
0
        /// <summary>
        /// Creates a new Add Amendment to add a new operative paragraph at a certain position. This will also create a virtual Paragraph at the stop where
        /// the new paragraph may be when it is accepted.
        /// </summary>
        /// <param name="section">The operative Section of the Resolution where this paragraph should be added.</param>
        /// <param name="targetIndex">The index where the paragraph should be added.</param>
        /// <param name="text">The Text of the new paragraph</param>
        /// <param name="parentParagraph">Use this parent paragraph if the new paragraph should be a sub point</param>
        /// <returns></returns>
        public static AddAmendment CreateAddAmendment(this OperativeSection section, int targetIndex, string text = "", OperativeParagraph parentParagraph = null)
        {
            var virtualParagraph = new OperativeParagraph(text)
            {
                IsVirtual = true,
                Visible   = false
            };

            section.InsertIntoRealPosition(virtualParagraph, targetIndex, parentParagraph);
            var amendment = new AddAmendment
            {
                TargetSectionId = virtualParagraph.OperativeParagraphId
            };

            section.PushAmendment(amendment);
            return(amendment);
        }
Example #4
0
        public void TestInstanceHasId()
        {
            var amendment = new AddAmendment();

            Assert.IsFalse(string.IsNullOrEmpty(amendment.Id));
        }