Beispiel #1
0
    public void CtorPassEmptyStrokesCollection()
    {
        var background  = ARGBColor.Default;
        var strokes     = Enumerable.Empty <SerializableStroke>().ToArray();
        var instruction = new SnapshotInstruction(background, strokes);

        Assert.Equal(background, instruction.Background);
        Assert.False(instruction.Strokes.Any());
    }
Beispiel #2
0
    public void ExecuteDrawingInstructionPassNull()
    {
        var background = ARGBColor.Default;
        var strokes    = new List <SerializableStroke> {
            new(_attributes, _points)
        };
        var instruction = new SnapshotInstruction(background, strokes);

        Assert.Throws <ArgumentNullException>(() => instruction.ExecuteDrawingInstruction(null));
    }
}
Beispiel #3
0
    public void Ctor()
    {
        var background = ARGBColor.Default;
        var strokes    = new List <SerializableStroke> {
            new(_attributes, _points)
        };
        var instruction = new SnapshotInstruction(background, strokes);

        Assert.Equal(background, instruction.Background);
        Assert.True(strokes.SequenceEqual(instruction.Strokes));
    }
Beispiel #4
0
    public void ExecuteDrawingInstruction()
    {
        var background = ARGBColor.Default;
        var strokes    = new List <SerializableStroke> {
            new(_attributes, _points)
        };
        var instruction    = new SnapshotInstruction(background, strokes);
        var repositoryMock = new Mock <IDrawingInstructionRepository>();

        instruction.ExecuteDrawingInstruction(repositoryMock.Object);

        repositoryMock.Verify(mock => mock.ApplySnapshot(instruction), Times.Once);
    }