示例#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
        }
示例#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
        }
示例#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 );
        }
示例#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 );
        }
示例#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
        }
示例#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
        }
示例#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
        }