Example #1
0
        public void FindTest()
        {
            // arrange
            ColorCollection target;
            int             expected;
            int             actual;

            target = new ColorCollection();
            target.Add(Color.Black);
            target.Add(Color.CornflowerBlue);
            target.Add(Color.Violet);
            expected = 1;

            // act
            actual = target.Find(Color.FromArgb(100, 149, 237));

            // assert
            actual.Should().Be(expected);
        }
Example #2
0
        public void FindNegativeTest()
        {
            // arrange
            ColorCollection target;
            int             expected;
            int             actual;

            target = new ColorCollection();
            target.Add(Color.Black);
            target.Add(Color.CornflowerBlue);
            target.Add(Color.Violet);
            expected = -1;

            // act
            actual = target.Find(Color.Yellow);

            // assert
            actual.Should().Be(expected);
        }
Example #3
0
        public void FindIgnoreAlphaNegativeTest()
        {
            // arrange
            ColorCollection target;
            int             expected;
            int             actual;

            target = new ColorCollection();
            target.Add(Color.Black);
            target.Add(Color.CornflowerBlue);
            target.Add(Color.Violet);
            expected = -1;

            // act
            actual = target.Find(Color.FromArgb(128, Color.CornflowerBlue), false);

            // assert
            actual.Should().Be(expected);
        }
    public void FindTest()
    {
      // arrange
      ColorCollection target;
      int expected;
      int actual;

      target = new ColorCollection();
      target.Add(Color.Black);
      target.Add(Color.CornflowerBlue);
      target.Add(Color.Violet);
      expected = 1;

      // act
      actual = target.Find(Color.FromArgb(100, 149, 237));

      // assert
      actual.Should().Be(expected);
    }
    public void FindNegativeTest()
    {
      // arrange
      ColorCollection target;
      int expected;
      int actual;

      target = new ColorCollection();
      target.Add(Color.Black);
      target.Add(Color.CornflowerBlue);
      target.Add(Color.Violet);
      expected = -1;

      // act
      actual = target.Find(Color.Yellow);

      // assert
      actual.Should().Be(expected);
    }
    public void FindIgnoreAlphaNegativeTest()
    {
      // arrange
      ColorCollection target;
      int expected;
      int actual;

      target = new ColorCollection();
      target.Add(Color.Black);
      target.Add(Color.CornflowerBlue);
      target.Add(Color.Violet);
      expected = -1;

      // act
      actual = target.Find(Color.FromArgb(128, Color.CornflowerBlue), false);

      // assert
      actual.Should().Be(expected);
    }