Example #1
0
func (t loadTask) GetParameters() []model.Parser {
	var parameters []model.Parser

	parameters = append(parameters, model.NewDateParameter("date", time.Now()))

	return parameters
}
	"testing"
	"time"

	"yotam/model"
)

var (
	ValidDateTests = []struct {
		value     string
		expected  time.Time
		parameter model.Parser
	}{
		{
			value:     "2015-01-01",
			expected:  time.Date(2015, time.January, 1, 0, 0, 0, 0, time.UTC),
			parameter: model.NewDateParameter("test", time.Now()),
		},
		{
			value:     "2015-01-01T12",
			expected:  time.Date(2015, time.January, 1, 12, 0, 0, 0, time.UTC),
			parameter: model.NewDateHourParameter("test", time.Now()),
		},
		{
			value:     "2015-01-01T12:12",
			expected:  time.Date(2015, time.January, 1, 12, 12, 0, 0, time.UTC),
			parameter: model.NewDateMinuteParameter("test", time.Now()),
		},
	}

	InvalidDateTests = []struct {
		parameter model.Parser