Test suppliers.ArgsGetSuppliers.asOptsGetSuppliers

This commit is contained in:
Anevo
2018-04-03 04:34:18 -04:00
committed by Dan Christian Bogos
parent 734a551903
commit 9c77b42f15

View File

@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package engine
import (
"fmt"
"reflect"
"testing"
"time"
@@ -667,3 +668,20 @@ func TestSuppliersSortedForEventWithLimitAndOffset(t *testing.T) {
t.Errorf("Expecting: %+v,received: %+v", utils.ToJSON(eFirstSupplierProfile), utils.ToJSON(sprf))
}
}
func TestSuppliersAsOptsGetSuppliers(t *testing.T) {
var s ArgsGetSuppliers
spl := &optsGetSuppliers{
ignoreErrors: false,
maxCost: 0.0,
}
fmt.Printf("Pointer spl: %+v\n", spl)
sprf, err := s.asOptsGetSuppliers()
fmt.Printf("Pointer sprf: %+v\n", sprf)
if err != nil {
t.Errorf("Error: %+v", err)
}
if !reflect.DeepEqual(spl, sprf) {
t.Errorf("Expecting: %+v,received: %+v", utils.ToJSON(spl), utils.ToJSON(sprf))
}
}