tdudzik

Untitled

Sep 22nd, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. package io.github.tdudzik.gameoflife;
  2.  
  3. import org.testng.annotations.Test;
  4.  
  5. import static org.testng.Assert.*;
  6.  
  7. public class CellTransformatorTest {
  8.  
  9.     @Test
  10.     public void transformEmptyCellWithLessThanThreeNeighbours() {
  11.         // given
  12.         CellTransformator cellTransformator = new CellTransformator();
  13.  
  14.         // when
  15.         Cell cellBeforeTransformation = new Cell();
  16.         Cell cellAfterTransformation = cellTransformator.transform(cellBeforeTransformation);
  17.  
  18.         // then
  19.         assertThat(cellAfterTransformation.isAlive()).isFalse();
  20.     }
  21.  
  22. }
  23.  
  24.  
  25. package io.github.tdudzik.gameoflife;
  26.  
  27. public class CellTransformator {
  28.  
  29.  
  30.     public Cell transform(Cell cellBeforeTransformation) {
  31.         return null;
  32.     }
  33.  
  34. }
  35.  
  36.  
  37. package io.github.tdudzik.gameoflife;
  38.  
  39. public final class Cell {
  40.  
  41.     private final boolean alive;
  42.  
  43.     public Cell(boolean alive) {
  44.         this.alive = alive;
  45.     }
  46.  
  47.     public boolean isAlive() {
  48.         return alive;
  49.     }
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment