Example #1
0
    public void ExecuteDrawingInstructionPassNull()
    {
        var color       = new ARGBColor(100, 100, 100, 100);
        var instruction = new ChangeBackgroundInstruction(color);

        Assert.Throws <ArgumentNullException>(() => instruction.ExecuteDrawingInstruction(null));
    }
Example #2
0
    public void CtorArgbColor()
    {
        var color       = new ARGBColor(100, 100, 100, 100);
        var instruction = new ChangeBackgroundInstruction(color);

        Assert.Equal(instruction.Background, color);
    }
Example #3
0
    public void ExecuteDrawingInstruction()
    {
        var repositoryMock = new Mock <IDrawingInstructionRepository>();
        var color          = new ARGBColor(100, 100, 100, 100);
        var instruction    = new ChangeBackgroundInstruction(color);

        instruction.ExecuteDrawingInstruction(repositoryMock.Object);

        repositoryMock.Verify(mock => mock.ChangeBackground(instruction), Times.Once);
    }
Example #4
0
    public void CtorColor()
    {
        var color = new Color {
            A = 100, R = 100, G = 100, B = 100
        };
        var instruction = new ChangeBackgroundInstruction(color);

        Assert.Equal(color.A, instruction.Background.A);
        Assert.Equal(color.R, instruction.Background.R);
        Assert.Equal(color.G, instruction.Background.G);
        Assert.Equal(color.B, instruction.Background.B);
    }