github
290 of 336 branches covered (86.31%)
Branch coverage included in aggregate %.
932 of 1017 new or added lines in 27 files covered. (91.64%)
932 of 1017 relevant lines covered (91.64%)
848.7 hits per line
| 1 |
namespace SatisfactoryTree.Logic.Models |
|
| 2 |
{
|
|
| 3 |
public class Building |
|
| 4 |
{
|
|
|
|
public string Name { get; set; } |
25,248✔ |
|
|
public double Power { get; set; } |
5,290✔ |
|
|
public double? MinPower { get; set; } |
609✔ |
|
|
public double? MaxPower { get; set; } |
609✔ |
| 9 |
|
|
| 10 |
// Parameterless constructor for JSON deserialization
|
|
|
|
public Building()
|
4,312✔ |
|
|
{
|
4,312✔ |
|
|
Name = string.Empty;
|
4,312✔ |
|
|
} |
4,312✔ |
| 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 |
} |