Exemple #1
0
        public void DeserializeConfigFile_FileDoesNotExist_RaiseFileNotFoundException()
        {
            // arrange
            NGinConfig config = new NGinConfig( this.testConfigFile.FullName );
            INGinConfigXml configXml = null;
            FileInfo fileNotExist = new FileInfo( "filenotexist.test.config" );
            // make sure file REALLY does not exist :-)
            Assert.IsFalse( fileNotExist.Exists );

            // act
            configXml = config.DeserializeConfigFile( fileNotExist.FullName );

            // assert
        }
Exemple #2
0
        public void DeserializeConfigFile_FileIsNull_RaiseArgumentNullException()
        {
            // arrange
            NGinConfig config = new NGinConfig( this.testConfigFile.FullName );
            INGinConfigXml configXml = null;
            string fileNull = null;

            // act
            configXml = config.DeserializeConfigFile( fileNull );

            // assert
        }
Exemple #3
0
        public void DeserializeConfigFile_ValidFile_Success()
        {
            // arrange
            NGinConfig config = new NGinConfig( this.testConfigFile.FullName );
            INGinConfigXml configXml = null;

            // act
            configXml = config.DeserializeConfigFile( this.testConfigFile.FullName );

            // assert
            Assert.IsNotNull( configXml );
            Assert.IsInstanceOf<INGinConfigXml>( configXml );
            Assert.IsNotNull( configXml.Modules );
            Assert.AreEqual( 2, configXml.Modules.Count );
        }