package main

import (
	"testing"
	"time"
)

func TestSendTemplateJoinVolunteer(t *testing.T) {
	SetupConfig()
	url := "http://www.google.com.au/"
	first := "很高兴有你参加志愿者"
	remark := "明天给你发1万块钱"
	name := "利于修"
	staffID := "1235465"
	joinDate := time.Now().Format("2006-01-02 15:04:06 Mon MST -07")
	totalCount := "50次"
	totalTime := "2小时"
	templateSendJoinVolunteer(toUser, url, first, remark, name, staffID, joinDate, totalCount, totalTime)
}

func TestSendTemplateJoinTeam(t *testing.T) {
	SetupConfig()
	url := "http://www.google.com.au/"
	first := "欢迎加入校友会服务团队"
	remark := "给你发2万张证书"
	teamname := "狂妄学习班"
	joinDate := time.Now().Format("2006-01-02 15:04:06 Mon MST -07")
	templateSendJoinTeam(toUser, url, first, remark, teamname, joinDate)
}

func TestSendTemplateCheckinSuccess(t *testing.T) {
	SetupConfig()
	url := "http://www.google.com.au/"
	first := "恭喜签到成功，你是第五位签到者"
	remark := "团结向上，一起发展"
	activity := "职业发展聚会"
	date := time.Now().Format("2006-01-02 15:04:06 Mon MST -07")
	venue := "某大直接800号，三单元六楼"
	templateSendCheckinSuccess(toUser, url, first, remark, activity, date, venue)
}

func TestSendTemplateMsgFormFillupDone(t *testing.T) {
	SetupConfig()
	url := "http://www.google.com.au"
	first := "您的录入信息已经收到，正在核实"
	remark := "若信息有误，会影响您校友会会员的资格"
	description := "会员登记信息需要补全"
	verificationDate := time.Now().Format("2006-01-02 15:04:05 Mon -07")
	templateSendFormFillupDone(toUser, url, first, remark, description, verificationDate)
}

func TestSendTemplateEnrollSuccess(t *testing.T) {
	SetupConfig()
	url := "http://www.google.com.au/"
	first := "即将到来的活动，欢迎你的到来"
	remark := "怎么才能让校友们积极互动是一个问题"
	host := "哈工大澳洲校友会"
	activity := "校友会团结聚会"
	date := time.Now().Format("2006-01-02 15:04:06 Mon MST -07")
	venue := "RSL Club"
	templateSendEnrollSuccess(toUser, url, first, remark, activity, host, venue, date)
}

func TestSendTemplateMeetingReminder(t *testing.T) {
	SetupConfig()
	url := "http://www.google.com.au/"
	first := "恭喜签到成功，你是第五位签到者"
	remark := "怎么才能让校友们积极互动是一个问题"
	subject := "校友会团结聚会"
	date := time.Now().Format("2006-01-02 15:04:06 Mon MST -07")
	venue := "某大直接800号，三单元六楼"
	templateSendMeetingReminder(toUser, url, first, remark, date, subject, venue)
}

func TestSendTemplateCheckinReminder(t *testing.T) {
	SetupConfig()
	url := "http://www.google.com.au/"
	first := "即将到来的活动，欢迎你的到来"
	remark := "来晚了罚钱，你大爷的"
	name := "2017年联欢晚会"
	subject := "校友会团结聚会"
	time := time.Now().Format("2006-01-02 15:04:06 Mon MST -07")
	templateSendCheckinReminder(toUser, url, first, remark, name, subject, time)
}

func TestSendTemplateMemberFeeReminder(t *testing.T) {
	SetupConfig()
	url := "http://www.google.com.au/"
	first := "校友会会员费\n"
	remark := "逾期不缴费将会被列出来"
	name := "王更新"
	paymentDeadline := time.Now().Format("2006-01-02 15:04:06 Mon MST -07")
	paymentValidDate := "从支付之日起一个月\n"
	paymentAmount := "￥200 "
	templateSendMemberFeeReminder(toUser, url, first, remark, name, paymentDeadline, paymentValidDate, paymentAmount)
}

func TestSendTemplatePaymentAck(t *testing.T) {
	SetupConfig()
	url := "http://www.google.com.au/"
	first := "即将到来的活动，欢迎你的到来"
	remark := "怎么才能让校友们积极互动是一个问题"
	account := "卢大勇 330609184"
	addr := "内西区，豪宅305号"
	amountpaid := "$ 300, ￥1000"
	balance := "$150"
	paidTo := "新华社，聚餐专款,（收款人：张曦）"
	templateSendPaymentAck(toUser, url, first, remark, account, addr, amountpaid, balance, paidTo)
}

func TestSendTemplateCheckinFail(t *testing.T) {
	SetupConfig()
	url := "http://www.google.com.au/"
	first := "--"
	remark := "checkin failed, due to your location is incorrect"
	activity := "2017年联欢晚会"
	date := time.Now().Format("2006-01-02 15:04:06 Mon MST -07")
	templateSendCheckinFail(toUser, url, first, remark, activity, date)
}

func TestSendTemplateInformCollection(t *testing.T) {
	SetupConfig()
	url := "http://www.google.com.au/"
	first := "恭喜你获得本次Lucky Draw奖金 $200澳币"
	remark := "请你点击详情，通知你已收到奖励"
	details := "2017年首次Lucky Draw 豪华版"
	date := time.Now().Format("2006-01-02 15:04:06 Mon MST -07")
	templateSendInformCollection(toUser, url, first, remark, date, details)
}

func TestSendTemplateMsgJoinCommunity(t *testing.T) {
	SetupConfig()
	url := "http://www.google.com.au"
	communityName := "小大同会"
	first := "欢迎加入Community" + communityName
	remark := "如果退出请注意缴费"
	joinDate := time.Now().Format("2006-01-02 15:04:06 Mon MST -07")
	templateSendJoinCommunity(toUser, url, first, remark, communityName, joinDate)
}
