public void TestAsStringUtf8_EncodingMissmatch() { var target = new MessagePackObject( Encoding.Unicode.GetBytes( _japanese ) ); Assert.Throws<InvalidOperationException>( () => target.AsStringUtf8() ); }
public void TestAsStringUtf8_Null_Success() { var target = new MessagePackObject( default( string ) ); Assert.IsNull( target.AsStringUtf8() ); }
public void TestAsStringUtf8_IsNotString() { var target = new MessagePackObject( 0 ); Assert.Throws<InvalidOperationException>( () => target.AsStringUtf8() ); }
public void TestAsStringUtf8_Normal_Success() { var target = new MessagePackObject( Encoding.UTF8.GetBytes( _japanese ) ); Assert.AreEqual( _japanese, target.AsStringUtf8() ); }
public void TestAsStringUtf8_Empty_Success() { var target = new MessagePackObject( new byte[ 0 ] ); Assert.AreEqual( "", target.AsStringUtf8() ); }
public void TestAsStringUtf8_IsNotString() { var target = new MessagePackObject( 0 ); target.AsStringUtf8(); }
public void TestAsStringUtf8_EncodingMissmatch() { var target = new MessagePackObject( Encoding.Unicode.GetBytes( _japanese ) ); var result = target.AsStringUtf8(); }
public void TestAsStringUtf8_EncodingMissmatch() { var target = new MessagePackObject(Encoding.Unicode.GetBytes(_japanese)); Assert.Throws <InvalidOperationException>(() => target.AsStringUtf8()); }
public void TestAsStringUtf8_IsNotString() { var target = new MessagePackObject(0); Assert.Throws <InvalidOperationException>(() => target.AsStringUtf8()); }
public void TestAsStringUtf8_Null_Success() { var target = new MessagePackObject(default(string)); Assert.IsNull(target.AsStringUtf8()); }
public void TestAsStringUtf8_Empty_Success() { var target = new MessagePackObject(new byte[0]); Assert.AreEqual("", target.AsStringUtf8()); }
public void TestAsStringUtf8_Normal_Success() { var target = new MessagePackObject(Encoding.UTF8.GetBytes(_japanese)); Assert.AreEqual(_japanese, target.AsStringUtf8()); }