Created
July 16, 2018 09:30
-
-
Save ramadani/614a767e9e646cbd85b493ecacfbf3d0 to your computer and use it in GitHub Desktop.
Snippet from Circle Test Code
This file contains 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 circle | |
import ( | |
"testing" | |
) | |
func TestArea(t *testing.T) { | |
circle := Circle{Radius: 10} | |
expected := 314.1592653589793 | |
actual := circle.Area() | |
if actual != expected { | |
t.Errorf("TestArea failed, expected: '%.2f', got: '%.2f'", expected, actual) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment