コード例 #1
0
ファイル: daemon_dialer_test.go プロジェクト: optimuse/csfw
package mail

import (
	"testing"

	"github.com/corestoreio/csfw/config"
	"github.com/stretchr/testify/assert"
)

var configMock = config.NewMockReader(
	config.MockInt(func(path string) int {
		//		println("int", path)
		switch path {
		case "stores/5015/system/smtp/port":
			return 0
		case "stores/6023/system/smtp/port":
			return 4040
		default:
			return 0
		}
	}),
	config.MockString(func(path string) string {
		//		println("string", path)
		switch path {
		case "stores/5015/system/smtp/host":
			return ""
		case "stores/5015/system/smtp/username":
			return ""
		case "stores/6023/system/smtp/host":
			return "smtp.fastmail.com"
		case "stores/6023/system/smtp/username":
コード例 #2
0
ファイル: mocks_test.go プロジェクト: hafeez3000/csfw
package email_test

import (
	"bytes"
	"io"
	"testing"

	"github.com/corestoreio/csfw/config"
	"github.com/corestoreio/csfw/utils/mail"
	"github.com/go-gomail/gomail"
	"github.com/stretchr/testify/assert"
)

var configMock = config.NewMockReader(
	config.MockInt(func(path string) int {
		//println("int", path)
		return 25 // Port 25
	}),
	config.MockString(func(path string) string {
		//println("string", path)
		return "localhost"
	}),
	config.MockBool(func(path string) bool {
		//println("bool", path)
		switch path {
		case "stores/3001/system/smtp/disable":
			return true
		case "stores/4010/system/smtp/disable":
			return false
		default:
			return false
		}