Skip to content

Commit

Permalink
if no multis were counted, the result is the equal to the points
Browse files Browse the repository at this point in the history
  • Loading branch information
ftl committed Oct 3, 2023
1 parent 3087c8c commit 340ddaa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,9 @@ func (s BandScore) QSOsPerMulti() float64 {
}

func (s BandScore) Result() int {
if s.Multis == 0 {
return s.Points
}
return s.Points * s.Multis
}

Expand Down
9 changes: 9 additions & 0 deletions core/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ func TestScore_StackedGraphPerBand(t *testing.T) {
assert.Equal(t, 28, stackedGraphs[2].DataPoints[0].QSOs)
}

func TestBandScore_NoMultis(t *testing.T) {
score := new(BandScore)
score.AddQSO(QSOScore{Points: 2})
score.AddQSO(QSOScore{Points: 2})
score.AddQSO(QSOScore{Points: 2})
score.AddQSO(QSOScore{Points: 2})
assert.Equal(t, 8, score.Result())
}

func TestBandmapEntry_ProximityFactor(t *testing.T) {
const frequency Frequency = 7035000
tt := []struct {
Expand Down

0 comments on commit 340ddaa

Please sign in to comment.