From 9c77b42f15e9f6cd058efa2ab196a01e419caf48 Mon Sep 17 00:00:00 2001 From: Anevo Date: Tue, 3 Apr 2018 04:34:18 -0400 Subject: [PATCH] Test suppliers.ArgsGetSuppliers.asOptsGetSuppliers --- engine/suppliers_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/engine/suppliers_test.go b/engine/suppliers_test.go index 9b392e801..24a02bae4 100644 --- a/engine/suppliers_test.go +++ b/engine/suppliers_test.go @@ -18,6 +18,7 @@ along with this program. If not, see 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)) + } +}