< Summary

Class:MUNity.Database.Models.Simulation.SimulationRole
Assembly:MUNity.Database
File(s):C:\Users\aeuke\source\repos\PeerConradi\munity\src\MUNityDatabase\Models\Simulation\SimulationRole.cs
Covered lines:0
Uncovered lines:17
Coverable lines:17
Total lines:53
Line coverage:0% (0 of 17)
Covered branches:0
Total branches:2
Branch coverage:0% (0 of 2)
Covered methods:0
Total methods:8
Method coverage:0% (0 of 8)

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_SimulationRoleId()100%10%
get_Name()100%10%
get_RoleType()100%10%
get_Iso()100%10%
get_Simulation()100%10%
.ctor()100%10%
.ctor(...)100%10%
IsDelegateOrNgo()0%20%

File(s)

C:\Users\aeuke\source\repos\PeerConradi\munity\src\MUNityDatabase\Models\Simulation\SimulationRole.cs

#LineLine coverage
 1using MUNity.Base;
 2using System;
 3using System.Collections.Generic;
 4using System.ComponentModel.DataAnnotations;
 5using System.Linq;
 6using System.Text.Json.Serialization;
 7using System.Threading.Tasks;
 8
 9namespace MUNity.Database.Models.Simulation;
 10
 11public class SimulationRole
 12{
 13
 14    /// <summary>
 15    /// The Id for this SimulationRole.
 16    /// </summary>
 017    public int SimulationRoleId { get; set; }
 18
 19    /// <summary>
 20    /// The name of the Role for example Delegate of Germany.
 21    /// </summary>
 22    [MaxLength(250)]
 023    public string Name { get; set; }
 24
 025    public RoleTypes RoleType { get; set; }
 26
 27    /// <summary>
 28    /// The iso of this role. For example DE for Germany or UK for United Kingdom.
 29    /// Read all about the Alpha-2 codes here:
 30    /// https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
 31    /// </summary>
 32    [MaxLength(5)]
 033    public string Iso { get; set; }
 34
 035    public Simulation Simulation { get; set; }
 36
 037    public SimulationRole()
 038    {
 39
 040    }
 41
 042    public SimulationRole(string iso, string name, RoleTypes roleType)
 043    {
 044        this.Iso = iso;
 045        this.Name = name;
 046        this.RoleType = roleType;
 047    }
 48
 49    public bool IsDelegateOrNgo()
 050    {
 051        return this.RoleType == RoleTypes.Delegate || this.RoleType == RoleTypes.Ngo;
 052    }
 53}