< Summary

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

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Instance()100%22100%
Safarimacik.Model.Purchasable.get_Price()100%11100%
.ctor()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>
 6public abstract class Plant(double nutrition) {
 7  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 {
 119    get {
 120      _instance ??= new();
 121      return _instance;
 122    }
 23  }
 124  int Purchasable.Price => Price;
 25
 126  private Weed() : base(25.5) { }
 27}