This file contains hidden or 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
| @Test | |
| public void shortRegularRental() { | |
| Customer customer = createCustomer(); | |
| addRental(customer, "Groundhog Day", Movie.REGULAR, 2); | |
| String expected = "Rental record for Luke\n"; | |
| expected += "\tGroundhog Day\t2.0\n"; | |
| expected += "Amount owed is 2.0\n"; | |
| expected += "You earned 1 frequent renter points"; |
This file contains hidden or 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
| public class RpnCalculator { | |
| @Test | |
| public void NewCalculatorHas0InItsAccumulator { ... } | |
| @Test | |
| public void NewAccumulatorShouldAllowItsAccumulatorToBeSet { ... } | |
| } |
This file contains hidden or 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
| public class ANewlyCreatedRpnCalculatorShould { | |
| private RpnCalculator calculator; | |
| @Before | |
| public void init(){ | |
| calculator = new RpnCalculator(); | |
| } | |
| @Test |
This file contains hidden or 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
| def test_fizzbuzz_de_1_a_20 | |
| sequence = [] | |
| 1.upto(20) do |n| | |
| fizzbuzz = FizzBuzz.new(n) | |
| sequence.push(fizzbuzz.run) | |
| end | |
| assert_equal '1,2,fizz,4,buzz,fizz,7,8,fizz,buzz,11,fizz,13,14,fizzbuzz,16,17,fizz,19,buzz', sequence.join(",") | |
| end |
This file contains hidden or 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 Agil; | |
| import robocode.*; | |
| import java.awt.Color; | |
| import static robocode.util.Utils.getRandom; | |
| /** | |
| * Rambo - a robot by @alex_aquiles | |
| */ | |
| public class Rambo extends Robot | |
| { |
This file contains hidden or 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
| from("jetty:http://localhost/myapp/myservice").process(new MyBookService()); | |
| from("smpp://smppclient@localhost:2775?password=password&enquireLinkTimer=3000&transactionTimer=5000&systemType=consumer").to("bean:foo"); | |
| from("imap://admin@mymailserver.com password=secret&processOnlyUnseenMessages=true&consumer.delay=60000").to("seda://mails"); |
This file contains hidden or 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
| pt-BR: | |
| errors: | |
| messages: | |
| not_found: 'não encontrado' | |
| already_confirmed: 'já foi confirmado' | |
| not_locked: 'não foi bloqueado' | |
| not_saved: | |
| one: '1 erro impediu que %{resource} fosse gravado:' | |
| other: '%{count} erros impediram que %{resource} fosse gravado:' |
This file contains hidden or 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
| def fatorial(number) | |
| if (number == 0) | |
| return 1 | |
| else | |
| return number * fatorial(number - 1) | |
| end | |
| end |
This file contains hidden or 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
| (defparameter *small* 1) | |
| (defparameter *big* 100) | |
| (defun guess-my-number () | |
| (ash (+ *small* *big*) -1)) | |
| (defun smaller () | |
| (setf *big* (1- (guess-my-number))) | |
| (guess-my-number)) |
This file contains hidden or 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
| def fibonacciSequence : Stream[Long] = { | |
| def fibonacciFrom(a: Long, b: Long) : Stream[Long] = a #:: fibonacciFrom(b, a+b) | |
| fibonacciFrom(0, 1) | |
| } |
OlderNewer