コード例 #1
0
    public void ExecuteDrawingInstruction_PassNull()
    {
        var stroke      = new SerializableStroke(_attributes, _points);
        var instruction = new EraseInstruction(stroke);

        Assert.Throws <ArgumentNullException>(() => instruction.ExecuteDrawingInstruction(null));
    }
コード例 #2
0
    public void CtorSerializableStroke()
    {
        var stroke      = new SerializableStroke(_attributes, _points);
        var instruction = new EraseInstruction(stroke);

        Assert.Equal(stroke, instruction.ErasingStroke);
    }
コード例 #3
0
    public void ExecuteDrawingInstruction()
    {
        var repositoryMock = new Mock <IDrawingInstructionRepository>();
        var stroke         = new SerializableStroke(_attributes, _points);
        var instruction    = new EraseInstruction(stroke);

        instruction.ExecuteDrawingInstruction(repositoryMock.Object);

        repositoryMock.Verify(instructionRepository => instructionRepository.Erase(instruction), Times.Once);
    }
コード例 #4
0
    public void CtorStroke()
    {
        var instruction = new EraseInstruction(_nonSerializableStroke);

        Assert.True(instruction.ErasingStroke.Points.SequenceEqual(_points));
        Assert.Equal(instruction.ErasingStroke.Attributes.Color, _attributes.Color);
        Assert.Equal(instruction.ErasingStroke.Attributes.Height, _attributes.Height);
        Assert.Equal(instruction.ErasingStroke.Attributes.Width, _attributes.Width);
        Assert.Equal(instruction.ErasingStroke.Attributes.IgnorePressure, _attributes.IgnorePressure);
        Assert.Equal(instruction.ErasingStroke.Attributes.IsHighlighter, _attributes.IsHighlighter);
        Assert.Equal(instruction.ErasingStroke.Attributes.StylusTip, _attributes.StylusTip);
    }