private AlignmentEntity getTestEntity(Document document) { ByNameObjectSelector <Alignment> selector = new ByNameObjectSelector <Alignment>(); selector.ObjectName = "Alignment - (1)"; selector.Select(document); Alignment alignment = selector.SelectedId.GetObject( acaddb.OpenMode.ForRead) as Alignment; return(alignment.Entities[0]); }
public void ReturnFalseIfSpecifiedObjectDoesNotExist() { using (Transaction tr = m_SelectionDocument.StartTransaction()) { ByNameObjectSelector <Alignment> selector = new ByNameObjectSelector <Alignment>(); selector.ObjectName = "Inexistent Alignment"; Assert.IsFalse(selector.Select(m_SelectionDocument), "Inexistent object cannot be selected."); } }
public void ReturnTrueIfSpecifiedObjectExists() { using (Transaction tr = m_SelectionDocument.StartTransaction()) { ByNameObjectSelector <Alignment> selector = new ByNameObjectSelector <Alignment>(); selector.ObjectName = "Alignment - (1)"; Assert.IsTrue(selector.Select(m_SelectionDocument), "Failed to find object."); } }
public void WriteInformationCorrectly() { Document doc = getTestDocument(); using (Transaction tr = doc.StartTransaction()) { ByNameObjectSelector <Alignment> selector = new ByNameObjectSelector <Alignment>(); selector.ObjectName = "Alignment - (1)"; selector.Select(doc); AlignmentEntityProcessor processor = new AlignmentEntityProcessor(selector.SelectedId); processor.EnumerationPolicy = new ByEntityIdEnumerationPolicy(); AlignmentEntityInfoWriterMock writer = new AlignmentEntityInfoWriterMock(); processor.WriteInfo(writer); Assert.AreEqual(_expectedOutput, writer.Output, "Incorrect information written."); } }