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 de.schauderhaft.kata.fizzbuzz | |
import org.scalatest.FunSuite | |
import org.scalatest.matchers.ShouldMatchers | |
import org.scalatest.junit.JUnitRunner | |
import org.junit.runner.RunWith | |
@RunWith(classOf[JUnitRunner]) | |
class FizzBuzzTest extends FunSuite with ShouldMatchers { |
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 de.schauderhaft.testen | |
import org.scalatest.matchers.ShouldMatchers | |
import org.scalatest.FunSuite | |
import org.junit.runner.RunWith | |
import org.scalatest.junit.JUnitRunner | |
import org.scalatest.BeforeAndAfterEach | |
@RunWith(classOf[JUnitRunner]) | |
class DemonstrationTest extends FunSuite with ShouldMatchers { |
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
**before** | |
} catch (final Exception e) { | |
LOG.error(e.toString(), e); | |
return null; | |
} | |
**after** | |
} catch (final Exception e) { |
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
object SetSeq { | |
// Set has a + operator with the same argument type as the elements | |
// Set does not have a :+ operator (prepending/appending doesn't make sens with out an ordering of the elements) | |
// Seq has a :+ operator which takes any type and returns a Seq with appropriate supertype of existing and new elements | |
// if no + operator exists and a String is used as an argument the collection is converted to a String and the result concatenated with the argument | |
val intSet = Set(1,2,3) //> intSet : scala.collection.immutable.Set[Int] = Set(1, 2, 3) | |
val strSet = Set("a","b","c") //> strSet : scala.collection.immutable.Set[java.lang.String] = Set(a, b, c) | |
val intSeq = Seq(1,2,3) //> intSeq : Seq[Int] = List(1, 2, 3) |
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
import de.schauderhaft.degraph.configuration.NamedPattern; | |
import static de.schauderhaft.degraph.check.JCheck.*; | |
import org.junit.Test; | |
import static org.hamcrest.core.Is.*; | |
import static org.junit.Assert.assertThat; | |
import static de.schauderhaft.degraph.check.Check.classpath; |
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
http://www.calormen.com/jsbasic/ | |
10 GR | |
19 rem Himmel | |
20 color=14 | |
30 for y = 0 to 20 | |
40 HLIN 0,39 at y | |
50 next y |
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
210 GR | |
220 REM CHOOSE A RANDOM COLOR | |
230 COLOR=RND(16) | |
240 REM CHOOSE A RANDOM POINT (X,Y) | |
250 x=RND(40) | |
260 Y=RND(40) | |
235 print x | |
280 PLOT X,Y | |
290 REM COOSE ANOTHER RANDOM COLOR AND POINT | |
300 goto 230 |
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
#!/bin/bash | |
if [ $# -ne 1 ] | |
then | |
echo "Usage: `basename $0` LOCATION-NAME" | |
exit 1 | |
fi | |
# switch git configuration | |
cat ~/base.gitconfig ~/$1.gitconfig > ~/.gitconfig | |
# switch gradle configuration |
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
import static org.hamcrest.Matchers.containsString; | |
import static org.hamcrest.Matchers.is; | |
import static org.hamcrest.Matchers.not; | |
import static org.junit.Assert.assertThat; | |
public class SysoutRule implements TestRule { | |
private ByteOutputStream out; | |
public void contains(String 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
class $12DynamicWithPixieDustTest extends LambdaBasedTests {{ | |
List<Integer> ints = asList(Integer.MAX_VALUE, Integer.MIN_VALUE, -1, 0, 1, 2, 10); | |
for (Integer i : ints) { | |
for (Integer j : ints) { | |
test(format("adding integers is commutative (%d, %d)", i,j), () -> { | |
assertEquals(i + j, j + i); | |
}); | |
} | |
} |
OlderNewer