/**
 * @fileoverview Tests for per-series options.
 *
 * @author danvk@google.com (Dan Vanderkam)
 */
var perSeriesTestCase = TestCase("per-series");

perSeriesTestCase.prototype.setUp = function() {
  document.body.innerHTML = "<div id='graph'></div>";
};

perSeriesTestCase.prototype.tearDown = function() {
};


perSeriesTestCase.prototype.testPerSeriesFill = function() {
  var opts = {
    width: 480,
    height: 320,
    drawXGrid: false,
    drawYGrid: false,
    drawXAxis: false,
    drawYAxis: false,
    Y: { fillGraph: true },
    colors: [ '#FF0000', '#0000FF' ],
    fillAlpha: 0.15
  };
  var data = "X,Y,Z\n" +
      "1,0,0\n" +
      "2,0,1\n" +
      "3,0,1\n" +
      "4,0,0\n" +
      "5,0,0\n" +
      "6,1,0\n" +
      "7,1,0\n" +
      "8,0,0\n"
  ;

  var graph = document.getElementById("graph");
  g = new Dygraph(graph, data, opts);

  var sampler = new PixelSampler(g);

  // Inside of the "Z" bump -- no fill.
  assertEquals([0,0,0,0], sampler.colorAtCoordinate(2.5, 0.5));

  // Inside of the "Y" bump -- filled in.
  assertEquals([255,0,0,38], sampler.colorAtCoordinate(6.5, 0.5));
};

perSeriesTestCase.prototype.testOldStyleSeries = function() {
  var opts = {
    pointSize : 5,
    Y: { pointSize : 4 },
  };
  var data = "X,Y,Z\n1,0,0\n";
  g = new Dygraph("Graph", data, opts);

  assertEquals(5, g.getOption("pointSize"));
  assertEquals(4, g.getOption("pointSize", "Y"));
  assertEquals(5, g.getOption("pointSize", "Z"));
};


@@ -1248,214 +1248,1387 @@
 var 
-data = %22X,Y,Z%5Cn1,0,0%5Cn%22;%0A  g = new Dygraph(%22Graph%22, data, opts);%0A%0A  assertEquals(5, g.getOption(%22pointSize%22));%0A  assertEquals(4, g.getOption(%22pointSize%22, %22Y%22));%0A  assertEquals(5, g.getOption(%22pointSize%22, %22Z
+graph = document.getElementById(%22graph%22);%0A  var data = %22X,Y,Z%5Cn1,0,0%5Cn%22;%0A  g = new Dygraph(graph, data, opts);%0A%0A  assertEquals(5, g.getOption(%22pointSize%22));%0A  assertEquals(4, g.getOption(%22pointSize%22, %22Y%22));%0A  assertEquals(5, g.getOption(%22pointSize%22, %22Z%22));%0A%7D;%0A%0AperSeriesTestCase.prototype.testNewStyleSeries = function() %7B%0A  var opts = %7B%0A    pointSize : 5,%0A    series : %7B%0A      Y: %7B pointSize : 4 %7D%0A    %7D,%0A  %7D;%0A  var graph = document.getElementById(%22graph%22);%0A  var data = %22X,Y,Z%5Cn1,0,0%5Cn%22;%0A  g = new Dygraph(graph, data, opts);%0A%0A  assertEquals(5, g.getOption(%22pointSize%22));%0A  assertEquals(4, g.getOption(%22pointSize%22, %22Y%22));%0A  assertEquals(5, g.getOption(%22pointSize%22, %22Z%22));%0A%7D;%0A%0AperSeriesTestCase.prototype.testNewStyleSeriesTrumpsOldStyle = function() %7B%0A  var opts = %7B%0A    pointSize : 5,%0A    Z : %7B pointSize : 6 %7D,%0A    series : %7B%0A      Y: %7B pointSize : 4 %7D%0A    %7D,%0A  %7D;%0A  var graph = document.getElementById(%22graph%22);%0A  var data = %22X,Y,Z%5Cn1,0,0%5Cn%22;%0A  g = new Dygraph(graph, data, opts);%0A%0A  assertEquals(5, g.getOption(%22pointSize%22));%0A  assertEquals(4, g.getOption(%22pointSize%22, %22Y%22));%0A  assertEquals(5, g.getOption(%22pointSize%22, %22Z%22));%0A%0A  // Erase the series object, and Z will become visible again.%0A  g.updateOptions(%7B series : undefined %7D);%0A  assertEquals(5, g.getOption(%22pointSize%22));%0A  assertEquals(6, g.getOption(%22pointSize%22, %22Z%22));%0A  assertEquals(5, g.getOption(%22pointSize%22, %22Y
 %22));

Add per-series tests that validate new-style options and how they relate to old-style options.