github
280 of 326 branches covered (85.89%)
Branch coverage included in aggregate %.
887 of 983 new or added lines in 26 files covered. (90.23%)
887 of 983 relevant lines covered (90.23%)
728.21 hits per line
| 1 |
namespace SatisfactoryTree.Logic.Models |
|
| 2 |
{
|
|
| 3 |
public class Building |
|
| 4 |
{
|
|
|
|
public string Name { get; set; } |
18,589✔ |
|
|
public double Power { get; set; } |
4,674✔ |
|
|
public double? MinPower { get; set; } |
523✔ |
|
|
public double? MaxPower { get; set; } |
523✔ |
| 9 |
|
|
| 10 |
// Parameterless constructor for JSON deserialization
|
|
|
|
public Building()
|
3,080✔ |
|
|
{
|
3,080✔ |
|
|
Name = string.Empty;
|
3,080✔ |
|
|
} |
3,080✔ |
| 15 |
|
|
|
|
public Building(string name) |
3,111✔ |
|
|
{
|
3,111✔ |
|
|
Name = name; |
3,111✔ |
|
|
} |
3,111✔ |
| 20 |
|
|
| 21 |
public override bool Equals(object? obj) |
|
|
NEW
|
{
|
× |
|
NEW
|
if (obj is Building otherBuilding)
|
|
|
NEW
|
{
|
× |
|
NEW
|
return Name == otherBuilding.Name;
|
× |
| 26 |
} |
|
|
NEW
|
return false; |
× |
|
NEW
|
} |
× |
| 29 |
|
|
| 30 |
public override int GetHashCode() |
|
|
NEW
|
{
|
× |
|
NEW
|
return Name.GetHashCode();
|
× |
|
NEW
|
} |
× |
| 34 |
} |
|
| 35 |
} |