You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
957 B

package factory
import "testing"
func TestCashNormal_AcceptCash(t *testing.T) {
accept := CreateCashAccept(1)
if accept == nil {
t.Error("testing failed")
}
money := 300.0
ret := accept.AcceptCash(money)
t.Log("\t应付: ", money)
t.Log("\t实付: ", ret)
}
func TestCashRebate_AcceptCash(t *testing.T) {
accept := CreateCashAccept(2)
if accept == nil {
t.Error("testing failed")
}
money := 300.0
ret := accept.AcceptCash(money)
t.Log("\t应付: ", money)
t.Log("\t实付: ", ret)
}
func TestCashReturn_AcceptCash(t *testing.T) {
accept := CreateCashAccept(3)
if accept == nil {
t.Error("testing failed")
}
money := 300.0
ret := accept.AcceptCash(money)
t.Log("\t应付: ", money)
t.Log("\t实付: ", ret)
}
func TestCash(t *testing.T) {
accept := CreateCashAccept(4)
if accept == nil {
t.Fatal("testing failed")
}
money := 300.0
ret := accept.AcceptCash(money)
t.Log("\t应付: ", money)
t.Log("\t实付: ", ret)
}