-Fixed tests

-Fixed exception message line breaks to use Environment.NewLine
This commit is contained in:
James Newton-King
2014-11-11 12:06:30 +13:00
parent 7b4995523b
commit 1816f555ea
3 changed files with 7 additions and 4 deletions
@@ -1186,7 +1186,7 @@ keyword such as type of business.""
var json = SerializeWithNoRedundentIdProperties(dic1);
Assert.AreEqual(@"{
StringAssert.AreEqual(@"{
""$id"": ""1"",
""list1"": [
""A string!"",
@@ -69,7 +69,7 @@ namespace Newtonsoft.Json.Tests.Serialization
string myOtherArrayAsString = JsonConvert.SerializeObject(myOtherArray, Formatting.Indented);
Assert.AreEqual(@"[
StringAssert.AreEqual(@"[
[
{
""Key"": ""my value"",
@@ -733,8 +733,11 @@ namespace Newtonsoft.Json.Serialization
{
if (!JsonTypeReflector.FullyTrusted)
{
throw JsonSerializationException.Create(null, writer.ContainerPath, @"Type '{0}' implements ISerializable but cannot be serialized using the ISerializable interface because the current application is not fully trusted and ISerializable can expose secure data.
To fix this error either change the environment to be fully trusted, change the application to not deserialize the type, add JsonObjectAttribute to the type or change the JsonSerializer setting ContractResolver to use a new DefaultContractResolver with IgnoreSerializableInterface set to true.".FormatWith(CultureInfo.InvariantCulture, value.GetType()), null);
string message = @"Type '{0}' implements ISerializable but cannot be serialized using the ISerializable interface because the current application is not fully trusted and ISerializable can expose secure data." + Environment.NewLine +
@"To fix this error either change the environment to be fully trusted, change the application to not deserialize the type, add JsonObjectAttribute to the type or change the JsonSerializer setting ContractResolver to use a new DefaultContractResolver with IgnoreSerializableInterface set to true." + Environment.NewLine;
message = message.FormatWith(CultureInfo.InvariantCulture, value.GetType());
throw JsonSerializationException.Create(null, writer.ContainerPath, message, null);
}
OnSerializing(writer, contract, value);