Exemple #1
0
    public void Test_PassCountSummaryPalette_ChooseColour_MachineTargetRange()
    {
      var palette = new PassCountSummaryPalette();

      palette.Should().NotBeNull();

      palette.UseMachineTargetPass = true;
      palette.UseMachineTargetPass.Should().Be(true);

      var data = new SubGridCellPassDataPassCountEntryRecord(MEASURED_PASS_COUNT, TARGET_PASS_COUNT);
      var colors = new[]
      {
        palette.BelowPassTargetRangeColour,
        palette.BelowPassTargetRangeColour,
        palette.BelowPassTargetRangeColour,
        palette.BelowPassTargetRangeColour,
        palette.BelowPassTargetRangeColour,
        palette.BelowPassTargetRangeColour,
        palette.WithinPassTargetRangeColour,
        palette.AbovePassTargetRangeColour,
        palette.AbovePassTargetRangeColour
      };

      for (var i = 0; i < colors.Length; i++)
      {
        data.MeasuredPassCount = (ushort)(MEASURED_PASS_COUNT + i * PASS_COUNT_INCREMENT);
        palette.ChooseColour(data.MeasuredPassCount, data.TargetPassCount, data.TargetPassCount).Should().Be(colors[i]);
      }
    }
Exemple #2
0
    public void Test_PassCountSummaryPalette_Creation()
    {
      var palette = new PassCountSummaryPalette();

      palette.Should().NotBeNull();

      palette.TargetPassCountRange.Min.Should().Be(3);
      palette.TargetPassCountRange.Max.Should().Be(5);
      palette.UseMachineTargetPass.Should().Be(false);

      palette.AbovePassTargetRangeColour.Should().Be(Color.Red);
      palette.WithinPassTargetRangeColour.Should().Be(Color.Lime);
      palette.BelowPassTargetRangeColour.Should().Be(Color.Blue);

      palette.PaletteTransitions.Should().BeNull();
    }
Exemple #3
0
    public void Test_PassCountSummaryPalette_ChooseColour_NullOverrideTargetRange()
    {
      var palette = new PassCountSummaryPalette();

      palette.Should().NotBeNull();

      palette.TargetPassCountRange = new PassCountRangeRecord(CellPassConsts.NullPassCountValue, CellPassConsts.NullPassCountValue);
      palette.TargetPassCountRange.Min.Should().Be(CellPassConsts.NullPassCountValue);
      palette.TargetPassCountRange.Max.Should().Be(CellPassConsts.NullPassCountValue);

      var data = new SubGridCellPassDataPassCountEntryRecord(MEASURED_PASS_COUNT, TARGET_PASS_COUNT);
      var colors = new[] { Color.Empty, Color.Empty, Color.Empty, Color.Empty, Color.Empty, Color.Empty, Color.Empty, Color.Empty, Color.Empty };

      for (var i = 0; i < colors.Length; i++)
      {
        data.MeasuredPassCount = (ushort)(MEASURED_PASS_COUNT + i * PASS_COUNT_INCREMENT);
        palette.ChooseColour(data.MeasuredPassCount, data.TargetPassCount, data.TargetPassCount).Should().Be(colors[i]);
      }
    }