public void IsToPrint_CheckLastPage() { var pd = new PrintDefinition(); Assert.That(pd.IsToPrint(PrintAppendixes.Footer, 2, true), Is.False); pd.SetPrintAttribute(new PrintOnPageAttribute(PrintAppendixes.Footer, PrintPartDefinitionAttribute.LastPage)); Assert.That(pd.IsToPrint(PrintAppendixes.Footer, 2, true), Is.True); }
public void IsToPrint_IncludePage() { var pd = new PrintDefinition(); Assert.That(pd.IsToPrint(PrintAppendixes.Footer, 1, false), Is.False); pd.SetPrintAttribute(new PrintOnPageAttribute(PrintAppendixes.Footer, 2)); Assert.That(pd.IsToPrint(PrintAppendixes.Footer, 1, false), Is.False); Assert.That(pd.IsToPrint(PrintAppendixes.Footer, 2, false), Is.True); }
public void IsToPrint_CheckSinglePage() { var pd = new PrintDefinition(); pd.SetPrintAttribute(new PrintOnPageAttribute(PrintAppendixes.Footer, PrintPartDefinitionAttribute.LastPage)); // do not print on page #1 Assert.That(pd.IsToPrint(PrintAppendixes.Footer, 1, false), Is.False); // but print on last page Assert.That(pd.IsToPrint(PrintAppendixes.Footer, 1, true), Is.True); }
public void IsToPrint_InvalidArgumentException() { var pd = new PrintDefinition(); Assert.That(() => pd.IsToPrint((PrintAppendixes)(-1), 1, false), Throws.ArgumentException); }
public void SetPrintAttribute_Null_ThrowsException() { var pd = new PrintDefinition(); Assert.That(() => pd.SetPrintAttribute(null), Throws.ArgumentNullException); }
public void SetPrintAttribute() { var pd = new PrintDefinition(); pd.SetPrintAttribute(new PrintOnPageAttribute(PrintAppendixes.Footer, 1)); Assert.That(pd.IsDefined(PrintAppendixes.Footer), Is.True); }
public void IsToPrint_NegativePage_ThrowsException() { var pd = new PrintDefinition(); pd.SetPrintAttribute(new PrintOnAllPagesAttribute(PrintAppendixes.Footer)); Assert.That(() => pd.IsToPrint(PrintAppendixes.Footer, -1, false), Throws.InstanceOf<ArgumentOutOfRangeException>()); }