public void OverridenEqualsPassNull()
    {
        var stroke = new SerializableStroke(_attributes, _points);
        var result = stroke.Equals(null);

        Assert.False(result);
    }
    public void EqualsPassNull()
    {
        IEquatable <SerializableStroke> stroke = new SerializableStroke(_attributes, _points);
        SerializableStroke?anotherStroke       = null;
        var result = stroke.Equals(anotherStroke);

        Assert.False(result);
    }
    public void OverridenEqualsForEqualStrokes()
    {
        var stroke        = new SerializableStroke(_attributes, _points);
        var anotherPoints = new Point[_points.Length];

        _points.CopyTo(anotherPoints, 0);
        var anotherStroke = new SerializableStroke(_attributes, anotherPoints);

        var strokeInstanceResult        = stroke.Equals((object)anotherStroke);
        var anotherStrokeInstanceResult = anotherStroke.Equals((object)stroke);

        Assert.True(strokeInstanceResult);
        Assert.True(anotherStrokeInstanceResult);
    }
    public void EqualsForNonEqualStrokesByPoints()
    {
        var stroke        = new SerializableStroke(_attributes, _points);
        var anotherPoints = new Point[_points.Length];

        _points.CopyTo(anotherPoints, 0);
        anotherPoints[0] = new Point(anotherPoints[0].X + 1, anotherPoints[0].Y - 1);
        var anotherStroke = new SerializableStroke(_attributes, anotherPoints);

        var strokeInstanceResult        = stroke.Equals(anotherStroke);
        var anotherStrokeInstanceResult = anotherStroke.Equals(stroke);

        Assert.False(strokeInstanceResult);
        Assert.False(anotherStrokeInstanceResult);
    }
    public void EqualsForNonEqualStrokesByAttributes()
    {
        var stroke        = new SerializableStroke(_attributes, _points);
        var anotherPoints = new Point[_points.Length];

        _points.CopyTo(anotherPoints, 0);
        var anotherAttributes = new StrokeAttributes
        {
            Color          = ARGBColor.Default,
            Height         = stroke.Attributes.Height + 2,
            Width          = 2,
            IgnorePressure = true,
            IsHighlighter  = !stroke.Attributes.IsHighlighter,
            StylusTip      = StylusTip.Ellipse
        };
        var anotherStroke = new SerializableStroke(anotherAttributes, anotherPoints);

        var strokeInstanceResult        = stroke.Equals(anotherStroke);
        var anotherStrokeInstanceResult = anotherStroke.Equals(stroke);

        Assert.False(strokeInstanceResult);
        Assert.False(anotherStrokeInstanceResult);
    }