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 lsug | |
import org.scalatest.FunSuite | |
/** | |
* Created by rich on 17/09/15. | |
*/ | |
class LCDFormatterTest extends FunSuite { | |
val formatter = new LCDFormatter |
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 lsug | |
/** | |
* Created by rich on 17/09/15. | |
*/ | |
class LCDDigit(val firstRow: String, val secondRow: String, val thirdRow: String) {} | |
object zero extends LCDDigit( | |
firstRow = "._.", | |
secondRow = "|.|", |
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 lsug | |
class LCDFormatter(){ | |
val digitMapping = Map( | |
0 -> zero, | |
1 -> one, | |
2 -> two, | |
3 -> three, | |
4 -> four, | |
5 -> five, |
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
case class LCDDigit(val firstRow: String, val secondRow: String, val thirdRow: String) { | |
def formatDigit(): Unit = { | |
productIterator.foreach(i => println(i)) | |
} | |
} |
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
class LCDDigit(val firstRow: String, val secondRow: String, val thirdRow: String) |
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 com.richashworth.testingutils.mocking; | |
public class Footballer { | |
private String name; | |
private int age; | |
private Double salary; | |
private Integer gamesPlayed; | |
private Integer goalsScored; | |
private Boolean isCaptain; |
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 com.richashworth.testingutils.mocking; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class DefaultValues { | |
private Map<String, Object> defaultValuesMap; | |
public DefaultValues() { |
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 com.richashworth.powermockexample; | |
import java.io.File; | |
import java.io.IOException; | |
import java.nio.charset.Charset; | |
import java.util.List; | |
import static com.google.common.io.Files.readLines; | |
public final class DataProvider { |
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 com.richashworth.testingutils.mocking; | |
import org.junit.Test; | |
import static junit.framework.Assert.assertEquals; | |
public class FootballerTest { | |
@Test | |
public void testGetGameGoalsRatio() { |
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 com.richashworth.testingutils.mocking; | |
import org.junit.Test; | |
import java.util.HashMap; | |
import java.util.Map; | |
import static junit.framework.Assert.assertEquals; | |
public class FootballerTest2 { |
OlderNewer