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()); }
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)); } }
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)); }
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); }