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

lucaslorentz / auto-compute / 11763467169

10 Nov 2024 08:07AM UTC coverage: 77.292% (-12.0%) from 89.255%
11763467169

push

github

lucaslorentz
Add initial support for computed navigations and observers

168 of 433 new or added lines in 25 files covered. (38.8%)

7 existing lines in 5 files now uncovered.

1467 of 1898 relevant lines covered (77.29%)

109.86 hits per line

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

61.9
/src/LLL.AutoCompute/ChangeCalculations/ValueChangeCalculation.cs
1

2
namespace LLL.AutoCompute.ChangeCalculations;
3

4
public record class ValueChangeCalculation<TValue>(IEqualityComparer<TValue>? comparer = null)
34✔
5
    : IChangeCalculation<TValue, ValueChange<TValue>>
6
{
7
    public bool IsIncremental => false;
57✔
8
    public bool PreLoadEntities => true;
36✔
9
    public IEqualityComparer<TValue> Comparer { get; } = comparer ?? EqualityComparer<TValue>.Default;
70✔
10

11
    public ValueChange<TValue> GetChange(IComputedValues<TValue> computedValues)
12
    {
13
        return new ValueChange<TValue>(
36✔
14
            computedValues.GetOriginalValue(),
36✔
15
            computedValues.GetCurrentValue()
36✔
16
        );
36✔
17
    }
18

19
    public ValueChange<TValue> CalculateChange(TValue original, TValue current)
20
    {
UNCOV
21
        return new ValueChange<TValue>(
×
22
            original,
×
23
            current
×
24
        );
×
25
    }
26

27
    public bool IsNoChange(ValueChange<TValue> result)
28
    {
29
        return Comparer.Equals(result.Original, result.Current);
36✔
30
    }
31

32
    public ValueChange<TValue> DeltaChange(ValueChange<TValue> previous, ValueChange<TValue> current)
33
    {
34
        return new ValueChange<TValue>(
2✔
35
            previous.Current,
2✔
36
            current.Current
2✔
37
        );
2✔
38
    }
39

40
    public ValueChange<TValue> ApplyChange(ValueChange<TValue> value, ValueChange<TValue> change)
41
    {
UNCOV
42
        return new ValueChange<TValue>(
×
43
            value.Original,
×
44
            change.Current
×
45
        );
×
46
    }
47
}
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