< Summary

Class:MUNity.Database.General.Country
Assembly:MUNity.Database
File(s):C:\Users\aeuke\source\repos\PeerConradi\munity\src\MUNityDatabase\Models\General\Country.cs
Covered lines:21
Uncovered lines:9
Coverable lines:30
Total lines:62
Line coverage:70% (21 of 30)
Covered branches:0
Total branches:0
Covered methods:9
Total methods:10
Method coverage:90% (9 of 10)

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_CountryId()100%1100%
get_Continent()100%1100%
get_Name()100%1100%
get_FullName()100%1100%
get_Iso()100%1100%
get_IsAccredited()100%1100%
get_Translations()100%1100%
.ctor(...)100%1100%
.ctor(...)100%10%
.ctor()100%1100%

File(s)

C:\Users\aeuke\source\repos\PeerConradi\munity\src\MUNityDatabase\Models\General\Country.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.ComponentModel.DataAnnotations;
 4using System.Linq;
 5using System.Text.Json.Serialization;
 6using System.Threading.Tasks;
 7using Microsoft.VisualBasic.CompilerServices;
 8using MUNity.Base;
 9
 10namespace MUNity.Database.General;
 11
 12/// <summary>
 13/// a country is one of the countries of the United Nations
 14///
 15/// https://www.worldometers.info/united-nations/
 16/// </summary>
 17public class Country
 18{
 19
 62120    public short CountryId { get; set; }
 21
 41622    public EContinent Continent { get; set; }
 23
 24    [MaxLength(250)]
 827825    public string Name { get; set; }
 26
 27    [MaxLength(350)]
 778928    public string FullName { get; set; }
 29
 30    [MaxLength(3)]
 70031    public string Iso { get; set; }
 32
 41433    public bool IsAccredited { get; set; }
 34
 82835    public ICollection<CountryNameTranslation> Translations { get; set; }
 36
 41337    public Country(short id, EContinent continent, string name, string fullName, string iso, bool isAccredited = true)
 41338    {
 41339        this.CountryId = id;
 41340        this.Continent = continent;
 41341        this.Name = name;
 41342        this.FullName = fullName;
 41343        this.Iso = iso;
 41344        this.IsAccredited = isAccredited;
 41345        this.Translations = new List<CountryNameTranslation>();
 41346    }
 47
 048    public Country(EContinent continent, string name, string fullName, string iso, bool isAccredited = true)
 049    {
 050        this.Continent = continent;
 051        this.Name = name;
 052        this.FullName = fullName;
 053        this.Iso = iso;
 054        this.IsAccredited = isAccredited;
 055        this.Translations = new List<CountryNameTranslation>();
 056    }
 57
 258    public Country()
 259    {
 260        this.Translations = new List<CountryNameTranslation>();
 261    }
 62}