示例#1
0
        public void TimetableFileModelExtensionsClass_ToTimetableDocumentMethod_ThrowsArgumentNullException_IfParameterIsNull()
        {
            TimetableFileModel testObject = null;

            _ = testObject.ToTimetableDocument();

            Assert.Fail();
        }
示例#2
0
        public void TimetableFileModelExtensionsClassToTimetableDocumentMethodReturnsTimetableDocumentObjectWithExportOptionsPropertyThatIsNotNullIfExportOptionsPropertyOfParameterIsNotNull()
        {
            TimetableFileModel testSourceObject = new TimetableFileModel {
                ExportOptions = new ExportOptionsModel()
            };

            TimetableDocument testResultObject = testSourceObject.ToTimetableDocument();

            Assert.IsNotNull(testResultObject.ExportOptions);
        }
示例#3
0
        public void TimetableFIleModelExtensionsClass_ToTimetableDocumentMethod_ThrowsArgumentNullExceptionWithCorrectParamNameProperty_IfParameterIsNull()
        {
            TimetableFileModel testObject = null;

            try
            {
                _ = testObject.ToTimetableDocument();
                Assert.Fail();
            }
            catch (ArgumentNullException ex)
            {
                Assert.AreEqual("file", ex.ParamName);
            }
        }
示例#4
0
        public void TimetableFileModelExtensionsClassToTimetableDocumentMethodReturnsTimetableDocumentObjectWithExportOptionsPropertyWithCorrectDisplayLocoDiagramRowPropertyIfExportOptionsPropertyOfParameterIsNotNull()
        {
            Random random = new Random();

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

                TimetableDocument testResultObject = testSourceObject.ToTimetableDocument();

                Assert.AreEqual(testValue, testResultObject.ExportOptions.DisplayLocoDiagramRow);
            }
        }