2017-05-03 06:52:14 +02:00
|
|
|
// Package that contains all api routes of this microservice
|
2017-04-04 23:21:05 +02:00
|
|
|
package http
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
2017-05-03 06:52:14 +02:00
|
|
|
// Function to test tempPercent() and tempProcessRadius()
|
2017-04-04 23:21:05 +02:00
|
|
|
func TestTempFuncs(t *testing.T) {
|
|
|
|
assert := assert.New(t)
|
2017-05-03 06:52:14 +02:00
|
|
|
resultInt := tempPercent(3, 9)
|
2017-04-04 23:21:05 +02:00
|
|
|
assert.Equal(33, resultInt)
|
|
|
|
|
2017-06-23 17:09:03 +02:00
|
|
|
resultInt = tempPercent(13, 9)
|
|
|
|
assert.Equal(100, resultInt)
|
|
|
|
|
2017-04-04 23:21:05 +02:00
|
|
|
// TODO is there a other way to calc this?
|
|
|
|
resultFloat := tempProcessRadius(3, 9, 0)
|
|
|
|
assert.Equal(float64(0), resultFloat)
|
2017-06-23 12:59:58 +02:00
|
|
|
|
|
|
|
resultFloat = tempProcessRadius(12, 9, 10)
|
|
|
|
assert.Equal(float64(0), resultFloat)
|
2017-04-04 23:21:05 +02:00
|
|
|
}
|