< Summary

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

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_Id()100%10%
.ctor()100%10%
get_Type()100%10%
set_Type(...)100%10%
get_Text()100%10%
set_Text(...)100%10%
NotifyPropertyChanged(...)0%20%

File(s)

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

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.ComponentModel;
 4using System.Runtime.CompilerServices;
 5using System.Text;
 6
 7namespace MUNity.Models.Resolution
 8{
 9    /// <summary>
 10    /// A tag for a comment that could display: importand, question etc.
 11    /// </summary>
 12    public class CommentTag : INotifyPropertyChanged
 13    {
 14        /// <summary>
 15        /// To Identify the Tag later
 16        /// </summary>
 017        public string Id { get; set; }
 18
 019        private string _type = "default";
 20        /// <summary>
 21        /// A Tag has a type, for example: success, danger, error etc.
 22        /// The types are inside a string for more felxibility. The Start Type (default type) is
 23        /// "default".
 24        /// </summary>
 25        public string Type {
 026            get => _type;
 27            set
 028            {
 029                _type = value;
 030                NotifyPropertyChanged(nameof(Type));
 031            }
 32        }
 33
 034        private string _text = "";
 35        /// <summary>
 36        /// The Text of the Tag, should be short but is not limited by default.
 37        /// </summary>
 38        public string Text {
 039            get => _type;
 40            set
 041            {
 042                _text = value;
 043                NotifyPropertyChanged(nameof(Text));
 044            }
 45        }
 46
 47        /// <summary>
 48        /// Creates a new Comment Tag and will give it an id.
 49        /// </summary>
 050        public CommentTag()
 051        {
 052            this.Id = Guid.NewGuid().ToString();
 053        }
 54
 55        /// <summary>
 56        /// Event that is fired when a property has changed.
 57        /// </summary>
 58        public event PropertyChangedEventHandler PropertyChanged;
 59
 60        /// <summary>
 61        /// Internal Event to fire the Property Changed event.
 62        /// </summary>
 63        /// <param name="name"></param>
 64        protected void NotifyPropertyChanged([CallerMemberName] string name = null)
 065        {
 066            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
 067        }
 68    }
 69}