From 5a165d76ff4f8b46269b159bdd8c45653b71dbab Mon Sep 17 00:00:00 2001 From: Erik Ovegard Date: Tue, 1 Nov 2016 10:38:05 +0100 Subject: [PATCH] Changes based on code review by @anjdreas --- .../UnitsNetJsonConverterTests.cs | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/UnitsNet.Serialization.JsonNet.Tests/UnitsNetJsonConverterTests.cs b/UnitsNet.Serialization.JsonNet.Tests/UnitsNetJsonConverterTests.cs index ed1c1b70f4..4749e0cabc 100644 --- a/UnitsNet.Serialization.JsonNet.Tests/UnitsNetJsonConverterTests.cs +++ b/UnitsNet.Serialization.JsonNet.Tests/UnitsNetJsonConverterTests.cs @@ -235,9 +235,9 @@ public void UnitInIComparable_ExpectUnitCorrectlyDeserialized() { Value = Power.FromWatts(10) }; - JsonSerializerSettings jsonSerializerSettings = CreateJsonSerializerSettigns(); + JsonSerializerSettings jsonSerializerSettings = CreateJsonSerializerSettings(); - string json = JsonConvert.SerializeObject(testObjWithIComparable,jsonSerializerSettings); + string json = JsonConvert.SerializeObject(testObjWithIComparable, jsonSerializerSettings); var deserializedTestObject = JsonConvert.DeserializeObject(json,jsonSerializerSettings); @@ -252,7 +252,7 @@ public void DoubleInIComparable_ExpectUnitCorrectlyDeserialized() { Value = 10.0 }; - JsonSerializerSettings jsonSerializerSettings = CreateJsonSerializerSettigns(); + JsonSerializerSettings jsonSerializerSettings = CreateJsonSerializerSettings(); string json = JsonConvert.SerializeObject(testObjWithIComparable, jsonSerializerSettings); @@ -269,7 +269,7 @@ public void ClassInIComparable_ExpectUnitCorrectlyDeserialized() { Value = new ComparableClass() { Value = 10 } }; - JsonSerializerSettings jsonSerializerSettings = CreateJsonSerializerSettigns(); + JsonSerializerSettings jsonSerializerSettings = CreateJsonSerializerSettings(); string json = JsonConvert.SerializeObject(testObjWithIComparable, jsonSerializerSettings); var deserializedTestObject = JsonConvert.DeserializeObject(json, jsonSerializerSettings); @@ -286,7 +286,7 @@ public void OtherObjectWithUnitAndValue_ExpectCorrectResturnValues() Value = 5, Unit = "Test", }; - JsonSerializerSettings jsonSerializerSettings = CreateJsonSerializerSettigns(); + JsonSerializerSettings jsonSerializerSettings = CreateJsonSerializerSettings(); string json = JsonConvert.SerializeObject(testObjWithValueAndUnit, jsonSerializerSettings); TestObjWithValueAndUnit deserializedTestObject = JsonConvert.DeserializeObject(json, jsonSerializerSettings); @@ -308,20 +308,20 @@ public void ThreeObjectsInIComparableWithDifferentValues_ExpectAllCorrectlyDeser Value2 = comparable2, Value3 = comparable3, }; - JsonSerializerSettings jsonSerializerSettings = CreateJsonSerializerSettigns(); + JsonSerializerSettings jsonSerializerSettings = CreateJsonSerializerSettings(); string json = JsonConvert.SerializeObject(testObjWithIComparable, jsonSerializerSettings); var deserializedTestObject = JsonConvert.DeserializeObject(json, jsonSerializerSettings); Assert.That(deserializedTestObject.Value1.GetType(), Is.EqualTo(comparable1.GetType())); - Assert.That(((deserializedTestObject.Value1)), Is.EqualTo(comparable1)); + Assert.That((deserializedTestObject.Value1), Is.EqualTo(comparable1)); Assert.That(deserializedTestObject.Value2.GetType(), Is.EqualTo(comparable2.GetType())); - Assert.That(((deserializedTestObject.Value2)), Is.EqualTo(comparable2)); + Assert.That((deserializedTestObject.Value2), Is.EqualTo(comparable2)); Assert.That(deserializedTestObject.Value3.GetType(), Is.EqualTo(comparable3.GetType())); - Assert.That(((deserializedTestObject.Value3)), Is.EqualTo(comparable3)); + Assert.That((deserializedTestObject.Value3), Is.EqualTo(comparable3)); } - public static object[] TestObjectsForThreeObjectsInIComparableWithDifferentValues_ExpectAllCorrectlyDeserialized + private static object[] TestObjectsForThreeObjectsInIComparableWithDifferentValues_ExpectAllCorrectlyDeserialized { get { @@ -341,7 +341,7 @@ public static object[] TestObjectsForThreeObjectsInIComparableWithDifferentValue } } - private static JsonSerializerSettings CreateJsonSerializerSettigns() + private static JsonSerializerSettings CreateJsonSerializerSettings() { var jsonSerializerSettings = new JsonSerializerSettings() { @@ -353,13 +353,13 @@ private static JsonSerializerSettings CreateJsonSerializerSettigns() } } - internal class TestObj + private class TestObj { public Frequency? NullableFrequency { get; set; } public Frequency NonNullableFrequency { get; set; } } - internal class TestObjWithValueAndUnit : IComparable + private class TestObjWithValueAndUnit : IComparable { public double Value { get; set; } public string Unit { get; set; } @@ -370,7 +370,7 @@ public int CompareTo(object obj) } } - internal class ComparableClass : IComparable + private class ComparableClass : IComparable { public int Value { get; set; } public int CompareTo(object obj) @@ -394,12 +394,12 @@ public override int GetHashCode() } } - internal class TestObjWithIComparable + private class TestObjWithIComparable { public IComparable Value { get; set; } } - internal class TestObjWithThreeIComparable + private class TestObjWithThreeIComparable { public IComparable Value1 { get; set; }