< Summary

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

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_CommentId()100%10%
.ctor()100%10%
get_AuthorName()100%10%
set_AuthorName(...)100%10%
get_AuthorId()100%10%
set_AuthorId(...)100%10%
get_CreationDate()100%10%
set_CreationDate(...)100%10%
get_Title()100%10%
set_Title(...)100%10%
get_Text()100%10%
set_Text(...)100%10%
get_Tags()100%10%
get_ReadBy()100%10%
NotifyPropertyChanged(...)0%20%
SetTextNoNotifyPropertyChanged(...)100%10%

File(s)

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

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Collections.ObjectModel;
 4using System.ComponentModel;
 5using System.Runtime.CompilerServices;
 6using System.Text;
 7
 8namespace MUNity.Models.Resolution
 9{
 10    /// <summary>
 11    /// A Comment for an operative paragraph or a preamble paragraph to allow a discussion about the paragraphs.
 12    /// </summary>
 13    public class Comment : INotifyPropertyChanged
 14    {
 15        /// <summary>
 16        /// The Id of the comment
 17        /// </summary>
 018        public string CommentId { get; set; }
 19
 020        private string _authorName = "";
 21        /// <summary>
 22        /// The author name of the Comment
 23        /// </summary>
 24        public string AuthorName {
 025            get => _authorName;
 26            set
 027            {
 028                _authorName = value;
 029                NotifyPropertyChanged(nameof(AuthorName));
 030            }
 31        }
 32
 033        private string _authorId = "";
 34        /// <summary>
 35        /// The Id of the author if you can use if the author is logged in.
 36        /// </summary>
 37        public string AuthorId {
 038            get => _authorId;
 39            set
 040            {
 041                _authorId = value;
 042                NotifyPropertyChanged(nameof(AuthorId));
 043            }
 44        }
 45
 46        private DateTime _creationDate;
 47        /// <summary>
 48        /// The date the comment has been created, you can also use this a last Changed date.
 49        /// </summary>
 50        public DateTime CreationDate {
 051            get => _creationDate;
 52            set
 053            {
 054                _creationDate = value;
 055                NotifyPropertyChanged(nameof(CreationDate));
 056            }
 57        }
 58
 059        private string _title = "";
 60        /// <summary>
 61        /// The title of the comment. This can be set and will not be generated automaticaly.
 62        /// </summary>
 63        public string Title {
 064            get => _title;
 65            set
 066            {
 067                _title = value;
 068                NotifyPropertyChanged(nameof(Title));
 069            }
 70        }
 71
 072        private string _text = "";
 73        /// <summary>
 74        /// The text of the comment.
 75        /// </summary>
 76        public string Text {
 077            get => _text;
 78            set
 079            {
 080                _text = value;
 081                NotifyPropertyChanged(nameof(Text));
 082            }
 83        }
 84
 85        /// <summary>
 86        /// Tags that are added to the comment.
 87        /// </summary>
 088        public ObservableCollection<CommentTag> Tags { get; set; }
 89
 90        /// <summary>
 91        /// List of names that have marked to comment as read.
 92        /// </summary>
 093        public ObservableCollection<ResaCommentSign> ReadBy { get; set; }
 94
 95        /// <summary>
 96        /// Creates a new Instance of a comment for operative paragraphs or preamble paragraphs and give them a new guid
 97        /// </summary>
 098        public Comment()
 099        {
 0100            CommentId = Guid.NewGuid().ToString();
 0101            Tags = new ObservableCollection<CommentTag>();
 0102            ReadBy = new ObservableCollection<ResaCommentSign>();
 0103        }
 104
 105        /// <summary>
 106        /// Event that is fired when a property has changed.
 107        /// </summary>
 108        public event PropertyChangedEventHandler PropertyChanged;
 109
 110        /// <summary>
 111        /// Internal Event to fire the Property Changed event.
 112        /// </summary>
 113        /// <param name="name"></param>
 114        protected void NotifyPropertyChanged([CallerMemberName] string name = null)
 0115        {
 0116            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
 0117        }
 118
 119        public void SetTextNoNotifyPropertyChanged(string text)
 0120        {
 0121            this._text = text;
 0122        }
 123    }
 124}