Exemple #1
0
        public void DeserializeXmlAs_InvalidTypeValidBytes_RaisePluginNotFoundException()
        {
            // arrange
            ConfigBase config = new ConfigBaseTestImpl();
            Type expectedType = typeof( ThreadStaticAttribute );
            byte[] xmlRawBytes = System.Text.Encoding.UTF8.GetBytes( this.xmlRawPluginsConfig );
            object result = null;

            // act
            result = config.DeserializeXmlAs( expectedType.FullName, xmlRawBytes );

            // assert
        }
Exemple #2
0
        public void DeserializeXmlAs_TypeNameNull_RaiseArgumentNulLException()
        {
            // arrange
            ConfigBase config = new ConfigBaseTestImpl();
            Type expectedType = typeof( PluginsConfigXml );
            string typeName = null;
            byte[] xmlRawBytes = System.Text.Encoding.UTF8.GetBytes( this.xmlRawPluginsConfig );
            object result = null;

            // act
            result = config.DeserializeXmlAs( typeName, xmlRawBytes );

            // assert
        }
Exemple #3
0
        public void DeserializeXmlAs_ValidTypeValidXmlBytes_Success()
        {
            // arrange
            ConfigBase config = new ConfigBaseTestImpl();
            Type expectedType = typeof( PluginsConfigXml );
            byte[] xmlRawBytes = System.Text.Encoding.UTF8.GetBytes( this.xmlRawPluginsConfig );
            object result = null;

            // act
            result = config.DeserializeXmlAs( expectedType.FullName, xmlRawBytes );

            // assert
            Assert.IsNotNull( result );
            Assert.IsInstanceOf( expectedType, result );
        }
Exemple #4
0
        public void DeserializeXmlAs_ValidTypeNameValidXml_Success()
        {
            // arrange
            ConfigBase config = new ConfigBaseTestImpl();
            Type expectedType = typeof( PluginsConfigXml );
            string xmlRaw = this.xmlRawPluginsConfig;
            object result = null;

            // act
            result = config.DeserializeXmlAs( expectedType.FullName, xmlRaw );

            // assert
            Assert.IsNotNull( result );
            Assert.IsInstanceOf( expectedType, result );
        }
Exemple #5
0
        public void DeserializeXmlAs_ValidTypeInvalidBytes_RaiseCoreConfigException()
        {
            // arrange
            ConfigBase config = new ConfigBaseTestImpl();
            Type expectedType = typeof( PluginsConfigXml );
            byte[] xmlRawBytes = Guid.NewGuid().ToByteArray();
            object result = null;

            // act
            result = config.DeserializeXmlAs( expectedType.FullName, xmlRawBytes );

            // assert
        }
Exemple #6
0
        public void DeserializeXmlAs_ValidTypeBytesNull_RaiseArgumentNullException()
        {
            // arrange
            ConfigBase config = new ConfigBaseTestImpl();
            Type expectedType = typeof( PluginsConfigXml );
            byte[] xmlRawBytes = null;
            object result = null;

            // act
            result = config.DeserializeXmlAs( expectedType.FullName, xmlRawBytes );

            // assert
        }
Exemple #7
0
        public void DeserializeXmlAs_TypeNullValidBytes_RaiseArgumentNullException()
        {
            // arrange
            ConfigBase config = new ConfigBaseTestImpl();
            Type typeNull = null;
            byte[] xmlRawBytes = System.Text.Encoding.UTF8.GetBytes( this.xmlRawPluginsConfig );
            object result = null;

            // act
            result = config.DeserializeXmlAs( typeNull, xmlRawBytes );

            // assert
        }