< Summary

Information
Class: Safarimacik.Model.Plant
Assembly: Safarimacik
File(s): /builds/szofttech-ab-2025/group-03/safarimacik/model/Plant.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 27
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Nutrition()100%11100%

File(s)

/builds/szofttech-ab-2025/group-03/safarimacik/model/Plant.cs

#LineLine coverage
 1namespace Safarimacik.Model;
 2
 3/// <summary>
 4/// Base class for all plants.
 5/// </summary>
 16public abstract class Plant(double nutrition) {
 17  public double Nutrition => nutrition;
 8}
 9
 10/// <summary>
 11/// Represents a purchasable plant
 12/// </summary>
 13public class Weed : Plant, Purchasable {
 14  public const int Price = 50;
 15
 16  private static Weed? _instance = null;
 17
 18  public static Weed Instance {
 19    get {
 20      _instance ??= new();
 21      return _instance;
 22    }
 23  }
 24  int Purchasable.Price => Price;
 25
 26  private Weed() : base(25.5) { }
 27}

Methods/Properties

.ctor(double)
get_Nutrition()