genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0
This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
hs_monolith/http/good_temp_test.go

26 lines
592 B
Go

// Package that contains all api routes of this microservice
package http
import (
"testing"
"github.com/stretchr/testify/assert"
)
// Function to test tempPercent() and tempProcessRadius()
func TestTempFuncs(t *testing.T) {
assert := assert.New(t)
resultInt := tempPercent(3, 9)
assert.Equal(33, resultInt)
resultInt = tempPercent(13, 9)
assert.Equal(100, resultInt)
// TODO is there a other way to calc this?
resultFloat := tempProcessRadius(3, 9, 0)
assert.Equal(float64(0), resultFloat)
resultFloat = tempProcessRadius(12, 9, 10)
assert.Equal(float64(0), resultFloat)
}