//-------------------------------------------------------------------------
        public virtual void coverage()
        {
            DoubleArray         values = DoubleArray.of(1, 2, 3);
            DoubleScenarioArray test   = DoubleScenarioArray.of(values);

            coverImmutableBean(test);
            DoubleArray         values2 = DoubleArray.of(1, 2, 3);
            DoubleScenarioArray test2   = DoubleScenarioArray.of(values2);

            coverBeanEquals(test, test2);
        }
        public virtual void create()
        {
            DoubleArray         values = DoubleArray.of(1, 2, 3);
            DoubleScenarioArray test   = DoubleScenarioArray.of(values);

            assertThat(test.Values).isEqualTo(values);
            assertThat(test.ScenarioCount).isEqualTo(3);
            assertThat(test.get(0)).isEqualTo(1d);
            assertThat(test.get(1)).isEqualTo(2d);
            assertThat(test.get(2)).isEqualTo(3);
            assertThat(test.ToList()).containsExactly(1d, 2d, 3d);
        }
        public virtual void create_fromFunction()
        {
            IList <double>      values = ImmutableList.of(1d, 2d, 3d);
            DoubleScenarioArray test   = DoubleScenarioArray.of(3, i => values[i]);

            assertThat(test.Values).isEqualTo(DoubleArray.of(1d, 2d, 3d));
            assertThat(test.ScenarioCount).isEqualTo(3);
            assertThat(test.get(0)).isEqualTo(1d);
            assertThat(test.get(1)).isEqualTo(2d);
            assertThat(test.get(2)).isEqualTo(3);
            assertThat(test.ToList()).containsExactly(1d, 2d, 3d);
        }
Exemplo n.º 4
0
 //-----------------------------------------------------------------------
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         DoubleScenarioArray other = (DoubleScenarioArray)obj;
         return(JodaBeanUtils.equal(values, other.values));
     }
     return(false);
 }