public void Flags_On_Set_Notify_Events_Are_Raised() { var state = new LineFixedLength(); var target = new PropertyChangedObserver(state); state.Flags = LineFixedLengthFlags.Start | LineFixedLengthFlags.Vertical | LineFixedLengthFlags.Horizontal; Assert.Equal( LineFixedLengthFlags.Start | LineFixedLengthFlags.Vertical | LineFixedLengthFlags.Horizontal, state.Flags); Assert.Equal(7, target.PropertyNames.Count); var propertyNames = new string[] { nameof(LineFixedLength.Flags), nameof(LineFixedLength.Disabled), nameof(LineFixedLength.Start), nameof(LineFixedLength.End), nameof(LineFixedLength.Vertical), nameof(LineFixedLength.Horizontal), nameof(LineFixedLength.All) }; Assert.Equal(propertyNames, target.PropertyNames); }
public void Parse_LineFixedLengthFlags_String() { var target = LineFixedLength.Parse("Start, Vertical, Horizontal"); Assert.Equal( LineFixedLengthFlags.Start | LineFixedLengthFlags.Vertical | LineFixedLengthFlags.Horizontal, target.Flags); }
public void End_Property() { var target = new LineFixedLength(); target.End = true; Assert.Equal(LineFixedLengthFlags.End, target.Flags); target.End = false; Assert.Equal(LineFixedLengthFlags.Disabled, target.Flags); }
/// <summary> /// Creates a new <see cref="LineStyle"/> instance. /// </summary> /// <param name="name">The line style name.</param> /// <param name="isCurved">The flag indicating whether line is curved.</param> /// <param name="curvature">The line curvature.</param> /// <param name="curveOrientation">The curve orientation.</param> /// <param name="fixedLength">The line style fixed length.</param> /// <returns>The new instance of the <see cref="LineStyle"/> class.</returns> public static LineStyle Create( string name = "", bool isCurved = false, double curvature = 50.0, CurveOrientation curveOrientation = CurveOrientation.Auto, LineFixedLength fixedLength = null) { return(new LineStyle() { Name = name, IsCurved = isCurved, Curvature = curvature, CurveOrientation = curveOrientation, FixedLength = fixedLength ?? LineFixedLength.Create() }); }
/// <summary> /// Creates a new <see cref="LineStyle"/> instance. /// </summary> /// <param name="name">The line style name.</param> /// <param name="isCurved">The flag indicating whether line is curved.</param> /// <param name="curvature">The line curvature.</param> /// <param name="curveOrientation">The curve orientation.</param> /// <param name="fixedLength">The line style fixed length.</param> /// <returns>The new instance of the <see cref="LineStyle"/> class.</returns> public static LineStyle Create( string name = "", bool isCurved = false, double curvature = 50.0, CurveOrientation curveOrientation = CurveOrientation.Auto, LineFixedLength fixedLength = null) { return new LineStyle() { Name = name, IsCurved = isCurved, Curvature = curvature, CurveOrientation = curveOrientation, FixedLength = fixedLength ?? LineFixedLength.Create() }; }
/// <summary> /// Parses a line fixed length string. /// </summary> /// <param name="s">The line fixed length string.</param> /// <returns>The <see cref="LineFixedLength"/>.</returns> public static LineFixedLength Parse(string s) { var flags = (LineFixedLengthFlags)Enum.Parse(typeof(LineFixedLengthFlags), s, true); return(LineFixedLength.Create(flags)); }
public void Vertical_Property() { var target = new LineFixedLength(); target.Vertical = true; Assert.Equal(LineFixedLengthFlags.Vertical, target.Flags); target.Vertical = false; Assert.Equal(LineFixedLengthFlags.Disabled, target.Flags); }
public void Inherits_From_ObservableObject() { var target = new LineFixedLength(); Assert.True(target is ObservableObject); }