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
| import xs from 'xstream'; | |
| import delay from 'xstream/extra/delay'; | |
| const computerProxy = xs.create(); | |
| const humanA = computerProxy.mapTo('pin'); | |
| const humanB = humanA.map((word) => word + 'g!'); | |
| const computer = humanB.map((word) => word.replace(/ping!/, 'pong!')).startWith('Hello World').compose(delay(500)); | |
| computerProxy.imitate(computer); | |
| computer.addListener({ |
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
| import xs from 'xstream'; | |
| import delay from 'xstream/extra/delay'; | |
| import dropRepeats from 'xstream/extra/dropRepeats'; | |
| import sampleCombine from 'xstream/extra/sampleCombine'; | |
| const intentPushedCola = xs.periodic(200).compose(delay(10)).mapTo({ name: 'Cola', price: 100 }); | |
| const intentPushedRedBull = xs.periodic(100).mapTo({ name: 'RedBull', price: 200 }); | |
| const intentPushedItem = xs.merge(intentPushedCola, intentPushedRedBull).compose(dropRepeats()); | |
| const intentInsertedCoin50 = xs.periodic(1000).mapTo(50); |
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
| import xs from 'xstream'; | |
| import delay from 'xstream/extra/delay'; | |
| import dropRepeats from 'xstream/extra/dropRepeats'; | |
| import sampleCombine from 'xstream/extra/sampleCombine'; | |
| const intentColaButton = xs.periodic(800).compose(delay(10)).mapTo({ name: 'Cola', price: 100 }); | |
| const intentRedBullButton = xs.periodic(500).mapTo({ name: 'Red Bull', price: 200 }); | |
| const intentItemButton = xs.merge(intentColaButton, intentRedBullButton).compose(dropRepeats()); | |
| const intentCoin50 = xs.periodic(1000).mapTo(50); |
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
| import xs from 'xstream'; | |
| import delay from 'xstream/extra/delay'; | |
| var refactorProxy = xs.create(); | |
| var red = refactorProxy.map((x) => 'Red:' + x).compose(delay(500)); | |
| var green = red.map((x) => x.replace(/Red/, 'GreenWithDebt')).compose(delay(500)); | |
| var refactor = green.map((x) => x.replace(/WithDebt/, '')).startWith('').compose(delay(500)); | |
| refactorProxy.imitate(refactor); | |
| red.addListener({ |
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
| import static java.util.Arrays.*; | |
| import static org.junit.jupiter.api.Assertions.*; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| import org.junit.jupiter.api.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
| package poker; | |
| import org.junit.jupiter.api.DisplayName; | |
| import org.junit.jupiter.api.Test; | |
| import static org.junit.jupiter.api.Assertions.assertEquals; | |
| import static poker.PokerHandHelper.*; | |
| public class PokerHandTest { | |
| @DisplayName("ワンペアならスコアは1000点(仮)であること") |
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 poker; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import static java.util.stream.Collectors.toList; | |
| public class Game { | |
| List<Player> players = new ArrayList(); |
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 poker; | |
| import org.junit.jupiter.api.DisplayName; | |
| import org.junit.jupiter.api.Nested; | |
| import org.junit.jupiter.api.Test; | |
| import static org.junit.jupiter.api.Assertions.assertEquals; | |
| import static poker.PokerHandHelper.highCard; | |
| import static poker.PokerHandHelper.onePair; |
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
| import org.junit.jupiter.api.BeforeEach; | |
| import org.junit.jupiter.api.DisplayName; | |
| import org.junit.jupiter.api.Nested; | |
| import org.junit.jupiter.api.Test; | |
| import java.util.EmptyStackException; | |
| import java.util.Stack; | |
| import static org.junit.jupiter.api.Assertions.assertEquals; | |
| import static org.junit.jupiter.api.Assertions.assertThrows; |
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
| #include "gmock/gmock.h" | |
| #include "gtest/gtest.h" | |
| using ::testing::NiceMock; | |
| using ::testing::Return; | |
| using ::testing::_; // Matcher for parameters | |
| // 隣人 | |
| class FugaServiceClient | |
| { |