From 2e9628a46a665f2cfc5559d8a6e97eb89e3d37a3 Mon Sep 17 00:00:00 2001 From: JohanLarsson Date: Mon, 10 Sep 2018 09:46:57 +0200 Subject: [PATCH] Renames. --- Gu.Xml.Tests/Helpers/Reference.cs | 2 +- Gu.Xml.Tests/XmlTests.SerializeCollections.cs | 2 +- .../XmlTests.SerializeComplextTypes.cs | 2 +- .../XmlTests.SerializePrimitiveTypes.cs | 42 +++++++++---------- Gu.Xml.Tests/XmlTests.SerializeProperties.cs | 4 +- .../XmlTests.SerializeWithXmlAttributes.cs | 10 ++--- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Gu.Xml.Tests/Helpers/Reference.cs b/Gu.Xml.Tests/Helpers/Reference.cs index 9ce364b..8ce3e92 100644 --- a/Gu.Xml.Tests/Helpers/Reference.cs +++ b/Gu.Xml.Tests/Helpers/Reference.cs @@ -6,7 +6,7 @@ public static class Reference { - public static string Xml(object value) + public static string XmlSerializer(object value) { var sb = new StringBuilder(); var serializer = new XmlSerializer(value.GetType()); diff --git a/Gu.Xml.Tests/XmlTests.SerializeCollections.cs b/Gu.Xml.Tests/XmlTests.SerializeCollections.cs index b023fce..1e0a144 100644 --- a/Gu.Xml.Tests/XmlTests.SerializeCollections.cs +++ b/Gu.Xml.Tests/XmlTests.SerializeCollections.cs @@ -23,7 +23,7 @@ public class SerializeCollections [TestCaseSource(nameof(Values))] public void Serialize(object value) { - var expected = Reference.Xml(value); + var expected = Reference.XmlSerializer(value); var actual = Xml.Serialize(value); if (actual == expected) { diff --git a/Gu.Xml.Tests/XmlTests.SerializeComplextTypes.cs b/Gu.Xml.Tests/XmlTests.SerializeComplextTypes.cs index 96d71a5..567d959 100644 --- a/Gu.Xml.Tests/XmlTests.SerializeComplextTypes.cs +++ b/Gu.Xml.Tests/XmlTests.SerializeComplextTypes.cs @@ -36,7 +36,7 @@ public class SerializeComplexTypes [TestCaseSource(nameof(Values))] public void Serialize(object value) { - var expected = Reference.Xml(value); + var expected = Reference.XmlSerializer(value); var actual = Xml.Serialize(value); if (actual == expected) { diff --git a/Gu.Xml.Tests/XmlTests.SerializePrimitiveTypes.cs b/Gu.Xml.Tests/XmlTests.SerializePrimitiveTypes.cs index 9d9612e..7434863 100644 --- a/Gu.Xml.Tests/XmlTests.SerializePrimitiveTypes.cs +++ b/Gu.Xml.Tests/XmlTests.SerializePrimitiveTypes.cs @@ -39,7 +39,7 @@ public void Byte(byte value) { var with = new WithMutable { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -53,7 +53,7 @@ public void SByte(sbyte value) { var with = new WithMutable { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -63,7 +63,7 @@ public void Boolean(bool value) { var with = new WithMutable { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -91,7 +91,7 @@ public void BooleanBoxed(bool value) { var with = new WithMutableBoxed { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -102,7 +102,7 @@ public void BoxedNullableBoolean(bool? value) { var with = new WithMutableBoxed { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -112,7 +112,7 @@ public void Char(char value) { var with = new WithMutable { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -120,7 +120,7 @@ public void Char(char value) public void Decimal(decimal value) { var with = new WithMutable { Value = value }; - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); var actual = Xml.Serialize(with); Assert.AreEqual(expected, actual); } @@ -145,7 +145,7 @@ public void Decimal(decimal value) public void Double(double value) { var with = new WithMutable { Value = value }; - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); var actual = Xml.Serialize(with); Assert.AreEqual(expected, actual); } @@ -156,7 +156,7 @@ public void EnumStringComparison(StringComparison value) { var with = new WithMutable { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -168,7 +168,7 @@ public void EnumCultureTypes(CultureTypes value) { var with = new WithMutable { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -192,7 +192,7 @@ public void EnumCultureTypes(CultureTypes value) public void Float(float value) { var with = new WithMutable { Value = value }; - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); var actual = Xml.Serialize(with); Assert.AreEqual(expected, actual); } @@ -203,7 +203,7 @@ public void Guid(string value) { var with = new WithMutable { Value = System.Guid.Parse(value) }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -216,7 +216,7 @@ public void Int16(short value) { var with = new WithMutable { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -225,7 +225,7 @@ public void Int32(int value) { var with = new WithMutable { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -234,7 +234,7 @@ public void Int32Nullable(int value) { var with = new WithMutable { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -243,7 +243,7 @@ public void Int32Boxed(int value) { var with = new WithMutableBoxed { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -259,7 +259,7 @@ public void Int64(long value) { var with = new WithMutable { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -274,7 +274,7 @@ public void String(string value) { var with = new WithMutable { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -284,7 +284,7 @@ public void UInt16(ushort value) { var with = new WithMutable { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -296,7 +296,7 @@ public void UInt32(uint value) { var with = new WithMutable { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } @@ -306,7 +306,7 @@ public void UInt64(ulong value) { var with = new WithMutable { Value = value }; var actual = Xml.Serialize(with); - var expected = Reference.Xml(with); + var expected = Reference.XmlSerializer(with); Assert.AreEqual(expected, actual); } diff --git a/Gu.Xml.Tests/XmlTests.SerializeProperties.cs b/Gu.Xml.Tests/XmlTests.SerializeProperties.cs index 15d3b23..6ae128a 100644 --- a/Gu.Xml.Tests/XmlTests.SerializeProperties.cs +++ b/Gu.Xml.Tests/XmlTests.SerializeProperties.cs @@ -11,14 +11,14 @@ public class SerializeProperties private static readonly TestCaseData[] Values = { new TestCaseData(new WithPublicGetSet { Value = 1 }), - new TestCaseData(new SerializeWithXmlAttributes.PropertyWithXmlIgnore { Value = 1 }), + new TestCaseData(new SerializeWithXmlAttributes.PropertyWithXmlIgnoreAttribute { Value = 1 }), new TestCaseData(new WithGetSetAndCalculated { Value = 1 }), }; [TestCaseSource(nameof(Values))] public void Serialize(object value) { - var expected = Reference.Xml(value); + var expected = Reference.XmlSerializer(value); var actual = Xml.Serialize(value); if (actual == expected) { diff --git a/Gu.Xml.Tests/XmlTests.SerializeWithXmlAttributes.cs b/Gu.Xml.Tests/XmlTests.SerializeWithXmlAttributes.cs index 52fb8f7..50e5dbd 100644 --- a/Gu.Xml.Tests/XmlTests.SerializeWithXmlAttributes.cs +++ b/Gu.Xml.Tests/XmlTests.SerializeWithXmlAttributes.cs @@ -13,13 +13,13 @@ public class SerializeWithXmlAttributes { new TestCaseData(new WithXmlRootAttribute { Value = 1 }), new TestCaseData(new WithXmlRootAttributeExplicitName { Value = 1 }), - new TestCaseData(new PropertyWithXmlIgnore { Value = 1 }), - new TestCaseData(new FieldWithXmlIgnore { Value = 1 }), + new TestCaseData(new PropertyWithXmlIgnoreAttribute { Value = 1 }), new TestCaseData(new PropertyWithXmlElementAttribute { Value = 1 }), new TestCaseData(new PropertyWithXmlElementAttributeExplicitName { Value = 1 }), new TestCaseData(new PropertyWithXmlAttributeAttribute { Value = 1 }), new TestCaseData(new PropertyWithXmlAttributeAttributeExplicitName { Value = 1 }), new TestCaseData(new ExplicitInterfaceWithXmlElementAttribute()), + new TestCaseData(new FieldWithXmlIgnoreAttribute { Value = 1 }), new TestCaseData(new FieldWithXmlElementAttribute { Value = 1 }), new TestCaseData(new FieldWithXmlElementAttributeExplicitName { Value = 1 }), new TestCaseData(new FieldWithXmlAttributeAttribute { Value = 1 }), @@ -29,7 +29,7 @@ public class SerializeWithXmlAttributes [TestCaseSource(nameof(Values))] public void Serialize(object value) { - var expected = Reference.Xml(value); + var expected = Reference.XmlSerializer(value); var actual = Xml.Serialize(value); if (actual == expected) { @@ -126,13 +126,13 @@ public class FieldWithXmlAttributeAttributeExplicitName public int Value; } - public class PropertyWithXmlIgnore + public class PropertyWithXmlIgnoreAttribute { [XmlIgnore] public int Value { get; set; } } - public class FieldWithXmlIgnore + public class FieldWithXmlIgnoreAttribute { [XmlIgnore] public int Value { get; set; }