Ejemplo n.º 1
0
        public void ExportOptionsModelExtensionsClassToDocumentExportOptionsMethodReturnsObjectThatIsNotNullIfParameterIsNotNull()
        {
            ExportOptionsModel testSourceObject = new ExportOptionsModel();

            DocumentExportOptions testResultObject = testSourceObject.ToDocumentExportOptions();

            Assert.IsNotNull(testResultObject);
        }
        public void ExportOptionsModelExtensionsClass_ToDocumentExportOptionsMethod_ThrowsNullReferenceException_IfParameterIsNull()
        {
            ExportOptionsModel testParam = null;

            testParam.ToDocumentExportOptions();

            Assert.Fail();
        }
        public void ExportOptionsModelExtensionsClass_ToDocumentExportOptionsMethod_ReturnsObjectWithDisplayToWorkRowPropertyEqualToFalse_IfParameterSetToWorkRowInOutputPropertyIsEqualToFalse()
        {
            ExportOptionsModel testParam = GetModel();

            testParam.SetToWorkRowInOutput = false;

            DocumentExportOptions testOutput = testParam.ToDocumentExportOptions();

            Assert.IsFalse(testOutput.DisplayToWorkRow);
        }
        public void ExportOptionsModelExtensionsClass_ToDocumentExportOptionsMethod_ReturnsObjectWithDisplayLocoDiagramRowPropertyEqualToFalse_IfParameterDisplayLocoDiagramRowPropertyIsEqualToNull()
        {
            ExportOptionsModel testParam = GetModel();

            testParam.DisplayLocoDiagramRow = null;

            DocumentExportOptions testOutput = testParam.ToDocumentExportOptions();

            Assert.IsFalse(testOutput.DisplayLocoDiagramRow);
        }
        public void ExportOptionsModelExtensionsClass_ToDocumentExportOptionsModel_ReturnsObjectWithFillerDashLineWidthPropertyEqualToZeroPointFive_IfFillerDashLineWidthPropertyOfParameterIsNull()
        {
            ExportOptionsModel testParam = GetModel();

            testParam.FillerDashLineWidth = null;

            DocumentExportOptions testOutput = testParam.ToDocumentExportOptions();

            Assert.AreEqual(0.5, testOutput.FillerDashLineWidth);
        }
        public void ExportOptionsModelExtensionsClass_ToDocumentExportOptionsModel_ReturnsObjectWithCorrectFillerDashLineWidthProperty_IfFillerDashLineWidthPropertyOfParameterIsNotNull()
        {
            ExportOptionsModel testParam = GetModel();

            testParam.FillerDashLineWidth = _rnd.NextDouble() * 5;

            DocumentExportOptions testOutput = testParam.ToDocumentExportOptions();

            Assert.AreEqual(testParam.FillerDashLineWidth, testOutput.FillerDashLineWidth);
        }
        public void ExportOptionsModelExtensionsClass_ToDocumentExportOptionsModel_ReturnsObjectWithLineWidthPropertyEqualTo1_IfLineWidthPropertyOfParameterIsNull()
        {
            ExportOptionsModel testParam = GetModel();

            testParam.LineWidth = null;

            DocumentExportOptions testOutput = testParam.ToDocumentExportOptions();

            Assert.AreEqual(1d, testOutput.LineWidth);
        }
        public void ExportOptionsModelExtensionsClass_ToDocumentExportOptionsMethod_ReturnsObjectWithDisplayGraphPropertyEqualToTrue_IfParameterGraphsInOutputPropertyIsEqualToNull()
        {
            ExportOptionsModel testParam = GetModel();

            testParam.GraphsInOutput = null;

            DocumentExportOptions testOutput = testParam.ToDocumentExportOptions();

            Assert.IsTrue(testOutput.DisplayGraph);
        }
        public void ExportOptionsModelExtensionsClass_ToDocumentExportOptionsMethod_ReturnsObjectWithDisplayGlossaryPropertyEqualToFalse_IfParameterGlossaryInOutputPropertyIsEqualToNull()
        {
            ExportOptionsModel testParam = GetModel();

            testParam.GlossaryInOutput = null;

            DocumentExportOptions testOutput = testParam.ToDocumentExportOptions();

            Assert.IsFalse(testOutput.DisplayGlossary);
        }
        public void ExportOptionsModelExtensionsClass_ToDocumentExportOptionsMethod_ReturnsObjectWithDisplayCreditsPropertyEqualToTrue_IfParameterCreditsInOutputPropertyIsEqualToTrue()
        {
            ExportOptionsModel testParam = GetModel();

            testParam.CreditsInOutput = true;

            DocumentExportOptions testOutput = testParam.ToDocumentExportOptions();

            Assert.IsTrue(testOutput.DisplayCredits);
        }
Ejemplo n.º 11
0
        public void ExportOptionsModelExtensionsClassToDocumentExportOptionsMethodReturnsObjectWithCorrectDisplayCreditsPropertyIfParameterIsNotNull()
        {
            Random random = new Random();

            for (int i = 0; i < TestMultipleRuns; ++i)
            {
                bool testValue = random.NextBoolean();
                ExportOptionsModel testSourceObject = new ExportOptionsModel {
                    CreditsInOutput = testValue
                };

                DocumentExportOptions testResultObject = testSourceObject.ToDocumentExportOptions();

                Assert.AreEqual(testValue, testResultObject.DisplayCredits);
            }
        }