Example #1
0
        public void CoreConfig_CreateInstanceValidFile_Success()
        {
            // arrange
            NGinConfig config;

            // act
            config = new NGinConfig( this.testConfigFile.FullName );

            // assert
            Assert.IsNotNull( config );
            Assert.IsInstanceOf<NGinConfig>( config );
        }
Example #2
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
        }
Example #3
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
        }
Example #4
0
        public void NGinConfig_CreateInstanceInvalidFile_RaiseFileNotFoundException()
        {
            // arrange
            NGinConfig config;
            string invalidFileName = Path.GetFileName( Path.GetTempFileName() );

            // act
            config = new NGinConfig( invalidFileName );

            // assert
        }
Example #5
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 );
        }