package kata func Multiple3And5(number int) bool { return number%3 == 0 && number%5 == 0 }
- package kata
func Multiple3And5(number int) int {// Code goes here- func Multiple3And5(number int) bool {
- return number%3 == 0 && number%5 == 0
- }
// TODO: replace with your own tests (TDD). An example to get you started is included below. // Ginkgo BDD Testing Framework <http://onsi.github.io/ginkgo/> // Gomega Matcher Library <http://onsi.github.io/gomega/> package kata_test import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . "codewarrior/kata" ) func dotest(n int, exp bool) { var ans = Multiple3And5(n) Expect(ans).To(Equal(exp)) } var _ = Describe("Test Example", func() { It("should handle basic cases", func() { dotest(15, true) dotest(30, true) dotest(9, false) }) })
- // TODO: replace with your own tests (TDD). An example to get you started is included below.
- // Ginkgo BDD Testing Framework <http://onsi.github.io/ginkgo/>
- // Gomega Matcher Library <http://onsi.github.io/gomega/>
- package kata_test
- import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- . "codewarrior/kata"
- )
- func dotest(n int, exp bool) {
- var ans = Multiple3And5(n)
- Expect(ans).To(Equal(exp))
- }
- var _ = Describe("Test Example", func() {
- It("should handle basic cases", func() {
- dotest(15, true)
- dotest(30, true)
- dotest(9, false)
- })
- })