public void FootnoteDisplayModelClassCopyToMethodThrowsArgumentNullExceptionIfParameterIsNull() { FootnoteDisplayModel testObject = GetTestObject(); testObject.CopyTo(null); Assert.Fail(); }
public void FootnoteDisplayModelClassCopyMethodReturnsDifferentObject() { FootnoteDisplayModel testObject = GetTestObject(); FootnoteDisplayModel testOutput = testObject.Copy(); Assert.AreNotSame(testObject, testOutput); }
public void FootnoteDisplayModelClassCopyMethodReturnsObjectWithSameDisplayOnPageProperty() { FootnoteDisplayModel testObject = GetTestObject(); FootnoteDisplayModel testOutput = testObject.Copy(); Assert.AreEqual(testObject.DisplayOnPage, testOutput.DisplayOnPage); }
public void NoteClass_ToFootnoteDisplayModelMethod_ReturnsFootnoteDisplayModelWithCorrectDisplayOnPagesProperty() { Note testObject = NoteHelpers.GetNote(); FootnoteDisplayModel testOutput = testObject.ToFootnoteDisplayModel(); Assert.AreEqual(testObject.DefinedOnPages, testOutput.DisplayOnPage); }
public void NoteClass_ToFootnoteDisplayModelMethod_ReturnsFootnoteDisplayModelWithCorrectSymbolProperty() { Note testObject = NoteHelpers.GetNote(); FootnoteDisplayModel testOutput = testObject.ToFootnoteDisplayModel(); Assert.AreEqual(testObject.Symbol, testOutput.Symbol); }
public void FootnoteDisplayModelClassCopyToMethodSetsDefinitionPropertyOfTarget() { FootnoteDisplayModel testObject = GetTestObject(); FootnoteDisplayModel targetObject = GetTestObject(); testObject.CopyTo(targetObject); Assert.AreEqual(testObject.Definition, targetObject.Definition); }
public void FootnoteDisplayModelClassCopyToMethodSetsSymbolPropertyOfTarget() { FootnoteDisplayModel testObject = GetTestObject(); FootnoteDisplayModel targetObject = GetTestObject(); testObject.CopyTo(targetObject); Assert.AreEqual(testObject.Symbol, targetObject.Symbol); }
/// <summary> /// Convert this <see cref="Note" /> to a <see cref="FootnoteDisplayModel" />. /// </summary> /// <returns>A <see cref="FootnoteDisplayModel" /> instance which can be used to display this note to a user.</returns> public FootnoteDisplayModel ToFootnoteDisplayModel() { FootnoteDisplayModel fdm = new FootnoteDisplayModel { NoteId = Id, Definition = Definition, Symbol = Symbol, DisplayOnPage = DefinedOnPages }; Modified += fdm.ParentModified; return(fdm); }
internal static PositionedLine ToPositionedLine(this FootnoteDisplayModel footnote, IGraphicsContext context, IFontDescriptor symbolFont, IFontDescriptor definitionFont) { Word symbolWord = new Word(footnote.Symbol, symbolFont, context, 5); // FIXME that very naked-looing "5" should definitely not be hard-coded. List <Word> theWords = new List <Word> { symbolWord }; theWords.AddRange(Word.MakeWords(footnote.Definition, definitionFont, context)); return(new PositionedLine(theWords)); }
public static void FullEqualityTest(FootnoteDisplayModel a, FootnoteDisplayModel b) { if (a is null) { throw new ArgumentNullException(nameof(a)); } if (b is null) { throw new ArgumentNullException(nameof(b)); } Assert.AreEqual(a.NoteId, b.NoteId); Assert.AreEqual(a.Symbol, b.Symbol); Assert.AreEqual(a.Definition, b.Definition); Assert.AreEqual(a.DisplayOnPage, b.DisplayOnPage); }