package api

import (
	"testing"

	"github.com/onsi/gomega"
)

func Test_GetAllowBlockSize(t *testing.T) {
	g := gomega.NewWithT(t)

	g.Expect(getBlockSizeInBytes(100)).To(gomega.Equal(int64(DefaultBlockSizeInBytes)))

	g.Expect(getBlockSizeInBytes(500 * 1024 * 1024)).To(gomega.Equal(int64(DefaultBlockSizeInBytes)))
	g.Expect(getBlockSizeInBytes(800 * 1024 * 1024)).To(gomega.Equal(int64((800 * 1024 * 1024) / 100)))

	g.Expect(getBlockSizeInBytes(7826675876)).To(gomega.Equal(int64(78266758)))
}
