コード例 #1
0
  @Test
  public void addLayerRejectsDuplicateLayer() {
    Layer topLayer = new Layer();

    assertTrue(network.addLayer(topLayer));
    assertFalse(network.addLayer(topLayer));
    assertEquals(topLayer, network.getOutputLayer());
  }
コード例 #2
0
  @Test
  public void addLayerAddsUniqueLayer() {
    Layer topLayer = new Layer();

    assertTrue(network.addLayer(topLayer));
    assertEquals(topLayer, network.getOutputLayer());
  }
コード例 #3
0
  @Test
  public void addLayerToANullLayerList() {
    Layer topLayer = new Layer();

    network.setLayers(null);
    assertTrue(network.addLayer(topLayer));
    assertEquals(topLayer, network.getOutputLayer());
  }
コード例 #4
0
 @Test
 public void addLayerDoesntAddNullLayer() {
   assertFalse(network.addLayer(null));
 }