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 }
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 }
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 ); }
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 ); }
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 }
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 }
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 }