push
github
298 of 344 branches covered (86.63%)
Branch coverage included in aggregate %.
951 of 1036 new or added lines in 28 files covered. (91.8%)
951 of 1036 relevant lines covered (91.8%)
861.84 hits per line
| 1 |
namespace SatisfactoryTree.Logic.Models |
|
| 2 |
{
|
|
| 3 |
public class Building |
|
| 4 |
{
|
|
|
|
public string Name { get; set; } |
27,096✔ |
|
|
public double Power { get; set; } |
5,906✔ |
|
|
public double? MinPower { get; set; } |
695✔ |
|
|
public double? MaxPower { get; set; } |
695✔ |
| 9 |
|
|
| 10 |
// Parameterless constructor for JSON deserialization
|
|
|
|
public Building()
|
5,544✔ |
|
|
{
|
5,544✔ |
|
|
Name = string.Empty;
|
5,544✔ |
|
|
} |
5,544✔ |
| 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 |
} |