• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

samsmithnz / SatisfactoryTree / 17365514447

01 Sep 2025 01:56AM UTC coverage: 39.13% (+2.6%) from 36.569%
17365514447

push

github

web-flow
Merge pull request #268 from samsmithnz/copilot/fix-263

Implement production planning system for specific products in Satisfactory WinForms app

466 of 631 branches covered (73.85%)

Branch coverage included in aggregate %.

159 of 180 new or added lines in 4 files covered. (88.33%)

1235 of 3716 relevant lines covered (33.23%)

2553.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.88
/src/SatisfactoryTree/Models/Factory.cs
1
namespace SatisfactoryTree.Models
2
{
3
    public class Factory
4
    {
5
        public Factory(string id, string name = "")
14✔
6
        {
14✔
7
            Id = id;
14✔
8
            Name = string.IsNullOrEmpty(name) ? $"Factory {id}" : name;
14✔
9
            Storage = new Storage(id);
14✔
10
            ProductionGoals = new List<ProductionGoal>();
14✔
11
        }
14✔
12

13
        public string Id { get; set; }
19✔
14
        public string Name { get; set; }
17✔
15
        public Storage Storage { get; set; }
31✔
16
        public List<ProductionGoal> ProductionGoals { get; set; }
26✔
17

18
        public ProductionGoal AddProductionGoal(string itemName, decimal targetQuantity)
19
        {
5✔
20
            var goal = new ProductionGoal(itemName, targetQuantity, Id);
5✔
21
            ProductionGoals.Add(goal);
5✔
22
            return goal;
5✔
23
        }
5✔
24

25
        public void RemoveProductionGoal(string goalId)
NEW
26
        {
×
NEW
27
            ProductionGoals.RemoveAll(g => g.Id == goalId);
×
NEW
28
        }
×
29

30
        public List<ProductionGoal> GetActiveGoals()
31
        {
6✔
32
            return ProductionGoals.Where(g => !g.IsCompleted).ToList();
17✔
33
        }
6✔
34

35
        public List<ProductionGoal> GetCompletedGoals()
36
        {
1✔
37
            return ProductionGoals.Where(g => g.IsCompleted).ToList();
3✔
38
        }
1✔
39

40
        public void ProcessProduction(string itemName, decimal quantity)
41
        {
5✔
42
            // Update active goals for this item
43
            var activeGoals = GetActiveGoals().Where(g => g.ItemName == itemName).ToList();
13✔
44
            decimal remainingQuantity = quantity;
5✔
45

46
            foreach (var goal in activeGoals)
27✔
47
            {
6✔
48
                if (remainingQuantity <= 0) break;
6✔
49

50
                var neededQuantity = goal.GetRemainingQuantity();
6✔
51
                var quantityToAllocate = Math.Min(neededQuantity, remainingQuantity);
6✔
52

53
                goal.UpdateProgress(quantityToAllocate);
6✔
54
                remainingQuantity -= quantityToAllocate;
6✔
55
            }
6✔
56

57
            // Send remaining quantity to storage
58
            if (remainingQuantity > 0)
5✔
59
            {
2✔
60
                Storage.AddItem(itemName, remainingQuantity);
2✔
61
            }
2✔
62
        }
5✔
63
    }
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc