namespace UglyToad.PdfPig.Tests.Graphics.Operations.SpecialGraphicsState { using PdfPig.Graphics; using PdfPig.Graphics.Operations.SpecialGraphicsState; public class PopTests { private readonly TestOperationContext context = new TestOperationContext(); [Fact] public void PopSymbolCorrect() { Assert.Equal("Q", Pop.Symbol); Assert.Equal("Q", Pop.Value.Operator); } [Fact] public void CannotPopWithSingleFrame() { Action action = () => Pop.Value.Run(context); Assert.Throws(action); } [Fact] public void CannotPopWithNoFrames() { context.StateStack.Pop(); Action action = () => Pop.Value.Run(context); Assert.Throws(action); } [Fact] public void PopsTopFrame() { context.StateStack.Push(new CurrentGraphicsState { LineWidth = 23 }); Pop.Value.Run(context); Assert.Equal(1, context.StackSize); Assert.Equal(1, context.GetCurrentState().LineWidth); } } }