Skip to content

Commit

Permalink
Renames.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanLarsson committed Sep 10, 2018
1 parent 36f9562 commit 2e9628a
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Gu.Xml.Tests/Helpers/Reference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion Gu.Xml.Tests/XmlTests.SerializeCollections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion Gu.Xml.Tests/XmlTests.SerializeComplextTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
42 changes: 21 additions & 21 deletions Gu.Xml.Tests/XmlTests.SerializePrimitiveTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void Byte(byte value)
{
var with = new WithMutable<byte> { Value = value };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

Expand All @@ -53,7 +53,7 @@ public void SByte(sbyte value)
{
var with = new WithMutable<sbyte> { Value = value };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

Expand All @@ -63,7 +63,7 @@ public void Boolean(bool value)
{
var with = new WithMutable<bool> { Value = value };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

Expand Down Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand All @@ -112,15 +112,15 @@ public void Char(char value)
{
var with = new WithMutable<char> { Value = value };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

[TestCaseSource(nameof(DecimalSource))]
public void Decimal(decimal value)
{
var with = new WithMutable<decimal> { Value = value };
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
var actual = Xml.Serialize(with);
Assert.AreEqual(expected, actual);
}
Expand All @@ -145,7 +145,7 @@ public void Decimal(decimal value)
public void Double(double value)
{
var with = new WithMutable<double> { Value = value };
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
var actual = Xml.Serialize(with);
Assert.AreEqual(expected, actual);
}
Expand All @@ -156,7 +156,7 @@ public void EnumStringComparison(StringComparison value)
{
var with = new WithMutable<StringComparison> { Value = value };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

Expand All @@ -168,7 +168,7 @@ public void EnumCultureTypes(CultureTypes value)
{
var with = new WithMutable<CultureTypes> { Value = value };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

Expand All @@ -192,7 +192,7 @@ public void EnumCultureTypes(CultureTypes value)
public void Float(float value)
{
var with = new WithMutable<float> { Value = value };
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
var actual = Xml.Serialize(with);
Assert.AreEqual(expected, actual);
}
Expand All @@ -203,7 +203,7 @@ public void Guid(string value)
{
var with = new WithMutable<Guid> { Value = System.Guid.Parse(value) };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

Expand All @@ -216,7 +216,7 @@ public void Int16(short value)
{
var with = new WithMutable<short> { Value = value };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

Expand All @@ -225,7 +225,7 @@ public void Int32(int value)
{
var with = new WithMutable<int> { Value = value };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

Expand All @@ -234,7 +234,7 @@ public void Int32Nullable(int value)
{
var with = new WithMutable<int?> { Value = value };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

Expand All @@ -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);
}

Expand All @@ -259,7 +259,7 @@ public void Int64(long value)
{
var with = new WithMutable<long> { Value = value };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

Expand All @@ -274,7 +274,7 @@ public void String(string value)
{
var with = new WithMutable<string> { Value = value };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

Expand All @@ -284,7 +284,7 @@ public void UInt16(ushort value)
{
var with = new WithMutable<ushort> { Value = value };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

Expand All @@ -296,7 +296,7 @@ public void UInt32(uint value)
{
var with = new WithMutable<uint> { Value = value };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

Expand All @@ -306,7 +306,7 @@ public void UInt64(ulong value)
{
var with = new WithMutable<ulong> { Value = value };
var actual = Xml.Serialize(with);
var expected = Reference.Xml(with);
var expected = Reference.XmlSerializer(with);
Assert.AreEqual(expected, actual);
}

Expand Down
4 changes: 2 additions & 2 deletions Gu.Xml.Tests/XmlTests.SerializeProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
10 changes: 5 additions & 5 deletions Gu.Xml.Tests/XmlTests.SerializeWithXmlAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
Expand All @@ -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)
{
Expand Down Expand Up @@ -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; }
Expand Down

0 comments on commit 2e9628a

Please sign in to comment.