forked from aksdb/CalAnonSync
24 lines
532 B
Go
24 lines
532 B
Go
package main
|
|
|
|
import "testing"
|
|
|
|
func TestStringAnonSettings_Apply(t *testing.T) {
|
|
t.Run("Not replaced when nil", func(t *testing.T) {
|
|
title := "Test"
|
|
var anonTitle *StringAnonSettings = nil
|
|
|
|
if anonTitle.Apply(title) != title {
|
|
t.Fatal("The title should be unchanged.")
|
|
}
|
|
})
|
|
|
|
t.Run("Not replaced when empty", func(t *testing.T) {
|
|
title := "Test"
|
|
var anonTitle *StringAnonSettings = &StringAnonSettings{ReplaceWith: ""}
|
|
|
|
if anonTitle.Apply(title) != title {
|
|
t.Fatal("The title should be unchanged.")
|
|
}
|
|
})
|
|
}
|