Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
markusressel committed Sep 21, 2024
1 parent 1ac0df8 commit 7a27aa5
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions internal/fans/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ func TestFileFan_GetFanCurveData(t *testing.T) {
// GIVEN
config := configuration.FanConfig{
File: &configuration.FileFanConfig{
Path: "../..////",
RpmPath: "../../test/non_existent_file",
Path: "../../test/file_fan_pwm",
RpmPath: "../../test/file_fan_rpm",
},
}

Expand All @@ -341,3 +341,42 @@ func TestFileFan_GetFanCurveData(t *testing.T) {
// THEN
assert.Equal(t, expectedFanCurve, *result)
}

func TestFileFan_GetCurveId(t *testing.T) {
// GIVEN
curveId := "curveId"
config := configuration.FanConfig{
Curve: curveId,
File: &configuration.FileFanConfig{
Path: "../../test/file_fan_pwm",
RpmPath: "../../test/file_fan_rpm",
},
}

fan, _ := NewFan(config)

// WHEN
result := fan.GetCurveId()

// THEN
assert.Equal(t, curveId, result)
}

func TestFileFan_ShouldNeverStop(t *testing.T) {
// GIVEN
config := configuration.FanConfig{
NeverStop: true,
File: &configuration.FileFanConfig{
Path: "../../test/file_fan_pwm",
RpmPath: "../../test/file_fan_rpm",
},
}

fan, _ := NewFan(config)

// WHEN
result := fan.ShouldNeverStop()

// THEN
assert.Equal(t, true, result)
}

0 comments on commit 7a27aa5

Please sign in to comment.