Esempio n. 1
0
        public void CombinatorCreatesNewInstance()
        {
            LegendConfigurator a = new();
            LegendConfigurator b = new();

            Combinator <LegendConfigurator> combinator = new(a, b);

            LegendConfigurator combined = combinator.Combine();

            Assert.False(ReferenceEquals(a, combined));
            Assert.False(ReferenceEquals(b, combined));
        }
Esempio n. 2
0
        public void CombinatorDoesNotOverrideSetProperties()
        {
            LegendConfigurator a = new();
            LegendConfigurator b = new();

            const LegendPlacement placement        = LegendPlacement.Inside;
            const LegendPlacement ignoredPlacement = LegendPlacement.Inside;

            b.Placement.Set(placement);
            a.Placement.Set(ignoredPlacement);

            Combinator <LegendConfigurator> combinator = new(a, b);
            LegendConfigurator combined = combinator.Combine();

            Assert.True(combined.Placement.IsSet);
            Assert.Equal(placement, combined.Placement.Value);
        }
Esempio n. 3
0
        public void CombinatorAddsDeclaredProperties()
        {
            LegendConfigurator a = new();
            LegendConfigurator b = new();

            const LegendPlacement placement = LegendPlacement.Inside;
            const LegendPosition  position  = LegendPosition.LeftTop;

            b.Placement.Set(placement);
            a.Position.Set(position);

            Combinator <LegendConfigurator> combinator = new(a, b);
            LegendConfigurator combined = combinator.Combine();

            Assert.True(combined.Placement.IsSet);
            Assert.True(combined.Position.IsSet);
            Assert.Equal(placement, combined.Placement.Value);
            Assert.Equal(position, combined.Position.Value);
        }
Esempio n. 4
0
 /// <summary>
 ///     Sets the legend placement.
 /// </summary>
 /// <param name="legend">The legend to configure.</param>
 /// <param name="placement">The placement.</param>
 public static LegendConfigurator SetPlacement(this LegendConfigurator legend, LegendPlacement placement)
 => legend.Set(l => l.Placement, placement);
Esempio n. 5
0
 /// <summary>
 ///     Sets the legend position.
 /// </summary>
 /// <param name="legend">The legend to configure.</param>
 /// <param name="position">The position.</param>
 public static LegendConfigurator SetPosition(this LegendConfigurator legend, LegendPosition position)
 => legend.Set(l => l.Position, position);