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]);
        }
コード例 #2
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.");
            }
        }
コード例 #3
0
        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.");
            }
        }
コード例 #4
0
        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.");
            }
        }