diff --git a/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs b/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs index 5fccb650..dbdf71c9 100644 --- a/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs +++ b/Tests/VocaluxeLib/Utils/Combinatorics/CCombinationsTest.cs @@ -26,6 +26,8 @@ namespace Tests.VocaluxeLib.Utils.Combinatorics [TestFixture] public class CCombinationsTest { + #region Tests + [Test] public void TestCount() { @@ -64,6 +66,10 @@ namespace Tests.VocaluxeLib.Utils.Combinatorics } } + #endregion + + #region Helper methods + // ReSharper disable UnusedParameter.Local private static void _CheckResults(CCombinations combs, List input) // ReSharper restore UnusedParameter.Local @@ -86,5 +92,7 @@ namespace Tests.VocaluxeLib.Utils.Combinatorics for (int i = 0; i < results2.Count; i++) Assert.IsTrue(results[i].SequenceEqual(results2[i])); } + + #endregion } } diff --git a/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs b/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs index b41a62e0..8c027489 100644 --- a/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs +++ b/Tests/VocaluxeLib/XML/CXmlSerializerTest.cs @@ -33,124 +33,7 @@ namespace Tests.VocaluxeLib.XML private const string _Head = "\r\n"; private const string _Empty = _Head + @""; -#pragma warning disable 649 -#pragma warning disable 169 - private struct SBasic - { - public int I; - public string S; - public float F; - public double D; - } - - [XmlType("Entry")] - private struct SEntry - { - public int I; - } - - private struct SList - { - [XmlArray] - public List Ints; - } - - private struct SArray - { - [XmlArray] - public SEntry[] Ints; - } - - private struct SListEmb - { - public int I; - [XmlElement("Entry")] - public List Ints; - public int J; - } - - private struct SArrayEmb - { - public int I; - [XmlElement("Entry")] - public SEntry[] Ints; - public int J; - } - - private struct SProperty - { - [XmlIgnore] - public int Private; - // ReSharper disable UnusedMember.Local - public int Public - { - get { return Private - 1; } - set { Private = value + 1; } - } - // ReSharper restore UnusedMember.Local - // ReSharper disable UnusedAutoPropertyAccessor.Local - public int Auto { get; set; } - // ReSharper restore UnusedAutoPropertyAccessor.Local - } - - private struct SBytes - { - public byte[] B; - } - - private struct SIgnore - { - [XmlIgnore] - public int I; - public int J; - } - - private class CIgnore - { - [XmlIgnore] - public int I; - public int J; - } - - private struct SDefaultSub - { - [DefaultValue(111)] - public int I; - } - - private struct SDefault - { - [DefaultValue(1337)] - public int I; - [DefaultValue("Foo")] - public string S; - public float? F; - [DefaultValue(666.0)] - public double D; - public SDefaultSub Sub; - } - -#pragma warning restore 169 -#pragma warning restore 649 - - private static void _AssertFail(String xmlString) where T2 : Exception where T : new() - { - var deserializer = new CXmlDeserializer(); - - Exception exception = - Assert.Catch(() => deserializer.DeserializeString(xmlString)); - Assert.IsInstanceOf(typeof(T2), exception); - } - - private static T _AssertSerDeserMatch(string xmlString) where T : new() - { - var deserializer = new CXmlDeserializer(); - var serializer = new CXmlSerializer(); - T foo = deserializer.DeserializeString(xmlString); - string xmlNew = serializer.Serialize(foo); - Assert.AreEqual(xmlString, xmlNew); - return foo; - } + #region Tests [Test] public void TestBasic() @@ -507,5 +390,129 @@ namespace Tests.VocaluxeLib.XML Assert.AreEqual(oldXml, newXml, "Recontructed XML has differences."); } + #endregion + + #region Helper + +#pragma warning disable 649 +#pragma warning disable 169 + private struct SBasic + { + public int I; + public string S; + public float F; + public double D; + } + + [XmlType("Entry")] + private struct SEntry + { + public int I; + } + + private struct SList + { + [XmlArray] + public List Ints; + } + + private struct SArray + { + [XmlArray] + public SEntry[] Ints; + } + + private struct SListEmb + { + public int I; + [XmlElement("Entry")] + public List Ints; + public int J; + } + + private struct SArrayEmb + { + public int I; + [XmlElement("Entry")] + public SEntry[] Ints; + public int J; + } + + private struct SProperty + { + [XmlIgnore] + public int Private; + // ReSharper disable UnusedMember.Local + public int Public + { + get { return Private - 1; } + set { Private = value + 1; } + } + // ReSharper restore UnusedMember.Local + // ReSharper disable UnusedAutoPropertyAccessor.Local + public int Auto { get; set; } + // ReSharper restore UnusedAutoPropertyAccessor.Local + } + + private struct SBytes + { + public byte[] B; + } + + private struct SIgnore + { + [XmlIgnore] + public int I; + public int J; + } + + private class CIgnore + { + [XmlIgnore] + public int I; + public int J; + } + + private struct SDefaultSub + { + [DefaultValue(111)] + public int I; + } + + private struct SDefault + { + [DefaultValue(1337)] + public int I; + [DefaultValue("Foo")] + public string S; + public float? F; + [DefaultValue(666.0)] + public double D; + public SDefaultSub Sub; + } + +#pragma warning restore 169 +#pragma warning restore 649 + + private static void _AssertFail(String xmlString) where T2 : Exception where T : new() + { + var deserializer = new CXmlDeserializer(); + + Exception exception = + Assert.Catch(() => deserializer.DeserializeString(xmlString)); + Assert.IsInstanceOf(typeof(T2), exception); + } + + private static T _AssertSerDeserMatch(string xmlString) where T : new() + { + var deserializer = new CXmlDeserializer(); + var serializer = new CXmlSerializer(); + T foo = deserializer.DeserializeString(xmlString); + string xmlNew = serializer.Serialize(foo); + Assert.AreEqual(xmlString, xmlNew); + return foo; + } + + #endregion } }