Skip to content

Commit 53bd2ac

Browse files
committed
addd new recipe FizzBuzzGoldenMaster w/ @samanthalangit
1 parent 246aea3 commit 53bd2ac

4 files changed

Lines changed: 29 additions & 2 deletions

File tree

0 Bytes
Binary file not shown.

TeachingKidsProgramming/src/org/teachingkidsprogramming/section09final/FizzBuzz.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
public class FizzBuzz
44
{
5-
// For the whole numbers from 1 to 100, print either that number, or,
5+
// For the whole numbers from 1 to 100, print either that number, or,
66
// If that number is evenly divisible by 3, then print the word 'Fizz',
77
// If that number is evenly divisible by 5, then print the word 'Buzz',
88
// If that number is evenly divisible by either 3 or 5, then print the word 'FizzBuzz'
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package org.teachingkidsprogramming.section09final;
2+
3+
import org.junit.Test;
4+
import org.teachingextensions.approvals.lite.Approvals;
5+
6+
public class FizzBuzzGoldenMaster
7+
{
8+
// Write a test using the GoldenMaster method via the TDD style for the convert method
9+
// IMPORTANT - GoldenMaster testing requires the use a of file compare tool
10+
// Download 'BeyondCompare' -- http://www.scootersoftware.com/download.php
11+
@Test
12+
public void testNumbers() throws Exception
13+
{
14+
// Arrange Create a list of numbers from 1-100
15+
// Act Call the convert method on the list
16+
// Verify The list is a Golden Master (uses .received and .approved files)
17+
Approvals.verify("1");
18+
}
19+
public static String convert(int i)
20+
{
21+
// For the whole numbers from 1 to 100, print either that number, or,
22+
// If that number is evenly divisible by 3, then print the word 'Fizz',
23+
// If that number is evenly divisible by 5, then print the word 'Buzz',
24+
// If that number is evenly divisible by either 3 or 5, then print the word 'FizzBuzz'
25+
return "";
26+
}
27+
}

TeachingKidsProgramming/src/org/teachingkidsprogramming/section09final/FizzBuzzTDD.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
public class FizzBuzzTDD
44
{
5-
// For the numbers being tested, print out either that number, or,
5+
// For the numbers being tested, print out either that number, or,
66
// If that number is evenly divisible by 3, then print the word 'Fizz',
77
// If that number is evenly divisible by 5, then print the word 'Buzz',
88
// If that number is evenly divisible by either 3 or 5, then print the word 'FizzBuzz'

0 commit comments

Comments
 (0)