Created
May 30, 2014 19:58
-
-
Save talbright/8d9560d510ff99a1612a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package desk | |
import ( | |
"fmt" | |
"testing" | |
. "github.com/smartystreets/goconvey/convey" | |
) | |
func TestJsonBuilder(t *testing.T) { | |
fmt.Println("") | |
Convey("Builder",t,func() { | |
Convey("builds StructA",func() { | |
structa:=StructABuilder.SetString("Name","trent").BuildStructA() | |
So(*structa.Name,ShouldEqual,"trent") | |
}) | |
Convey("builds StructB",func() { | |
structb:=StructBBuilder.SetString("Subject","unavoidable").BuildStructB() | |
So(*structb.Subject,ShouldEqual,"unavoidable") | |
}) | |
Convey("builds StructC with dervived methods",func(){ | |
structc:=StructCBuilder. | |
SetString("Subject","unavoidable"). | |
SetBody("too sexy for my shirt"). | |
BuildStructC() | |
So(*structc.Subject,ShouldEqual,"unavoidable") | |
So(*structc.Body,ShouldEqual,"too sexy for my shirt") | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment