Пример #1
0
        public void AcquirePackage_ExampleCategoryName_IsNotNull()
        {
            string            categoryName      = "Example category name";
            InfoOutputPackage infoOutputPackage = m_InfoOutput.AcquirePackage(categoryName);

            Assert.That(infoOutputPackage, Is.Not.Null);
        }
Пример #2
0
        public void GetPackage_UnknownCategoryName_ArgumentException()
        {
            void CheckForException()
            {
                string            categoryName      = "Unknown category name";
                InfoOutputPackage infoOutputPackage = m_InfoOutput.GetPackage(categoryName);
            }

            Assert.Throws <ArgumentException>(CheckForException);
        }
Пример #3
0
        /// <summary>Handles the Click event of the bCreateObject control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void bCreateObject_Click(object sender, EventArgs e)
        {
            SimpleDataObject simpleDataObject = new SimpleDataObject();

            InfoOutput infoOutput = new InfoOutput();

            simpleDataObject.FillInfoOutput(infoOutput);

            InfoOutputPackage generalPackage = infoOutput.GetGeneralPackage();

            InfoOutputParentChildDataTable parentChildDataTable = generalPackage.GetParentChildDataTable("ParentTable");

            InitializeDataGridViews(parentChildDataTable);
        }
Пример #4
0
        /// <summary>Gets informations of the current object as a specific <see cref="InfoOutput"/> instance.
        /// </summary>
        /// <param name="infoOutput">The <see cref="InfoOutput"/> object which is to be filled with informations concering the current instance.</param>
        /// <param name="categoryName">The name of the category, i.e. all informations will be added to these category.</param>
        public void FillInfoOutput(InfoOutput infoOutput, string categoryName = InfoOutput.GeneralCategoryName)
        {
            /* creates two simple data tables: */
            DataTable parentDataTable = new DataTable("ParentTable");

            parentDataTable.Columns.Add("Name", typeof(String));
            DataColumn masterColumn = new DataColumn("ID")
            {
                DataType = typeof(int)
            };

            parentDataTable.Columns.Add(masterColumn);
            masterColumn.ColumnMapping = MappingType.Hidden;


            DataTable childDataTable = new DataTable("ChildTable");

            childDataTable.Columns.Add("Value", typeof(DateTime));
            DataColumn slaveColumn = new DataColumn("ID")
            {
                DataType = typeof(int)
            };

            childDataTable.Columns.Add(slaveColumn);
            slaveColumn.ColumnMapping = MappingType.Hidden;

            /* add some simple data: */
            parentDataTable.Rows.Add("The child should show exactly 2 dates", 4);
            parentDataTable.Rows.Add("Exactly 1 date", 7);

            childDataTable.Rows.Add(new DateTime(2010, 10, 24), 4);
            childDataTable.Rows.Add(new DateTime(2012, 5, 15), 4);

            childDataTable.Rows.Add(new DateTime(1998, 2, 8), 7);

            /* store the parent-child data table in the package: */

            InfoOutputParentChildDataTable parentChildDataTable = new InfoOutputParentChildDataTable(parentDataTable, childDataTable, masterColumn, slaveColumn);

            InfoOutputPackage package = infoOutput.AcquirePackage(categoryName);

            package.Add(parentChildDataTable);
        }
Пример #5
0
        public void GetGeneralPackage_noArgument_IsNotNull()
        {
            InfoOutputPackage generalPackage = m_InfoOutput.GetGeneralPackage();

            Assert.That(generalPackage, Is.Not.Null);
        }
 public void SetUp()
 {
     m_InfoOutputPackage = new InfoOutputPackage(m_CategoryName);
 }