Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/22/10 00:44:01 (14 years ago)
Author:
swagner
Message:

Sorted usings and removed unused usings in entire solution (#1094)

Location:
trunk/sources/HeuristicLab.Persistence/3.3/Tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Tests/Properties/AssemblyInfo.cs

    r3742 r4068  
    2121
    2222using System.Reflection;
    23 using System.Runtime.CompilerServices;
    2423using System.Runtime.InteropServices;
    2524
  • trunk/sources/HeuristicLab.Persistence/3.3/Tests/StorableAttributeTests.cs

    r3742 r4068  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using HeuristicLab.Persistence.Core;
    25 using Microsoft.VisualStudio.TestTools.UnitTesting;
    2622using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using System.Reflection;
    2823
    2924namespace HeuristicLab.Persistence_33.Tests {
    3025
    31   [StorableClass] 
     26  [StorableClass]
    3227  class DemoClass {
    3328
     
    7469  }
    7570
    76 /*  [TestClass]
    77   public class AttributeTest {
     71  /*  [TestClass]
     72    public class AttributeTest {
    7873
    79     [TestMethod]
    80     public void SimpleStorableAttributeTest() {
    81       DemoClass t = new DemoClass();
    82       IEnumerable<DataMemberAccessor> accessorList = StorableAttribute.GetStorableAccessors(t);
    83       Dictionary<string, DataMemberAccessor> accessors = new Dictionary<string, DataMemberAccessor>();
    84       foreach (var a in accessorList)
    85         accessors.Add(a.Name, a);
    86       Assert.IsTrue(accessors.ContainsKey("TestProperty"));
    87       Assert.IsTrue(accessors.ContainsKey("x"));
    88       Assert.IsFalse(accessors.ContainsKey("y"));
    89       object o = new object();
    90       t.o = o;
    91       Assert.AreSame(accessors["TestProperty"].Get(), o);
    92       t.x = 12;
    93       Assert.AreEqual(accessors["x"].Get(), 12);
    94       t.y = 312890;
    95       accessors["TestProperty"].Set(null);
    96       Assert.IsNull(t.o);
    97       accessors["x"].Set(123);
    98       Assert.AreEqual(t.x, 123);
    99     }
     74      [TestMethod]
     75      public void SimpleStorableAttributeTest() {
     76        DemoClass t = new DemoClass();
     77        IEnumerable<DataMemberAccessor> accessorList = StorableAttribute.GetStorableAccessors(t);
     78        Dictionary<string, DataMemberAccessor> accessors = new Dictionary<string, DataMemberAccessor>();
     79        foreach (var a in accessorList)
     80          accessors.Add(a.Name, a);
     81        Assert.IsTrue(accessors.ContainsKey("TestProperty"));
     82        Assert.IsTrue(accessors.ContainsKey("x"));
     83        Assert.IsFalse(accessors.ContainsKey("y"));
     84        object o = new object();
     85        t.o = o;
     86        Assert.AreSame(accessors["TestProperty"].Get(), o);
     87        t.x = 12;
     88        Assert.AreEqual(accessors["x"].Get(), 12);
     89        t.y = 312890;
     90        accessors["TestProperty"].Set(null);
     91        Assert.IsNull(t.o);
     92        accessors["x"].Set(123);
     93        Assert.AreEqual(t.x, 123);
     94      }
    10095
    101     [TestMethod]
    102     public void TestInheritance() {
    103       New n = new New();
    104       var accessors = StorableAttribute.GetStorableAccessors(n);
    105       var accessDict = new Dictionary<string, DataMemberAccessor>();
    106       foreach (var accessor in accessors) // assert uniqueness
    107         accessDict.Add(accessor.Name, accessor);
    108       Assert.IsTrue(accessDict.ContainsKey(typeof(New).FullName + ".Name"));
    109       Assert.IsTrue(accessDict.ContainsKey(typeof(Override).FullName + ".Name"));
    110       Assert.AreEqual("New", accessDict[typeof(New).FullName + ".Name"].Get());
    111       Assert.AreEqual("Override", accessDict[typeof(Override).FullName + ".Name"].Get());
    112     }
     96      [TestMethod]
     97      public void TestInheritance() {
     98        New n = new New();
     99        var accessors = StorableAttribute.GetStorableAccessors(n);
     100        var accessDict = new Dictionary<string, DataMemberAccessor>();
     101        foreach (var accessor in accessors) // assert uniqueness
     102          accessDict.Add(accessor.Name, accessor);
     103        Assert.IsTrue(accessDict.ContainsKey(typeof(New).FullName + ".Name"));
     104        Assert.IsTrue(accessDict.ContainsKey(typeof(Override).FullName + ".Name"));
     105        Assert.AreEqual("New", accessDict[typeof(New).FullName + ".Name"].Get());
     106        Assert.AreEqual("Override", accessDict[typeof(Override).FullName + ".Name"].Get());
     107      }
    113108
    114   }*/
     109    }*/
    115110
    116111}
  • trunk/sources/HeuristicLab.Persistence/3.3/Tests/UseCases.cs

    r3946 r4068  
    2121
    2222using System;
     23using System.Collections;
     24using System.Collections.Generic;
     25using System.Drawing;
     26using System.IO;
     27using System.Linq;
     28using System.Reflection;
    2329using System.Text;
    24 using System.Collections.Generic;
    25 using System.Linq;
     30using System.Text.RegularExpressions;
     31using HeuristicLab.Persistence.Auxiliary;
     32using HeuristicLab.Persistence.Core;
     33using HeuristicLab.Persistence.Default.CompositeSerializers;
     34using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     35using HeuristicLab.Persistence.Default.DebugString;
     36using HeuristicLab.Persistence.Default.Xml;
     37using HeuristicLab.Persistence.Default.Xml.Primitive;
     38using HeuristicLab.Persistence.Interfaces;
    2639using Microsoft.VisualStudio.TestTools.UnitTesting;
    27 using HeuristicLab.Persistence.Core;
    28 using System.Collections;
    29 using HeuristicLab.Persistence.Default.Xml;
    30 using HeuristicLab.Persistence.Default.DebugString;
    31 using System.IO;
    32 using System.Reflection;
    33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    34 using HeuristicLab.Persistence.Interfaces;
    35 using HeuristicLab.Persistence.Default.Xml.Primitive;
    36 using HeuristicLab.Persistence.Default.CompositeSerializers;
    37 using HeuristicLab.Persistence.Auxiliary;
    38 using System.Text.RegularExpressions;
    39 using System.Drawing;
    40 using System.Drawing.Imaging;
    4140
    4241namespace HeuristicLab.Persistence_33.Tests {
     
    607606        XmlGenerator.Serialize(c, tempFile);
    608607        Assert.Fail("Exception not thrown");
    609       } catch (PersistenceException) {
     608      }
     609      catch (PersistenceException) {
    610610      }
    611611    }
     
    619619        XmlGenerator.Serialize(s, tempFile);
    620620        Assert.Fail("Exception expected");
    621       } catch (PersistenceException) { }
     621      }
     622      catch (PersistenceException) { }
    622623      List<int> newList = (List<int>)XmlParser.Deserialize(tempFile);
    623624      Assert.AreEqual(list[0], newList[0]);
     
    658659        }
    659660        Assert.Fail("Exception expected");
    660       } catch (PersistenceException px) {
     661      }
     662      catch (PersistenceException px) {
    661663        Assert.AreEqual(3, px.Data.Count);
    662664      }
     
    686688        d = new Deserializer(XmlParser.ParseTypeCache(new StringReader(newTypeString)));
    687689        Assert.Fail("Exception expected");
    688       } catch (PersistenceException x) {
     690      }
     691      catch (PersistenceException x) {
    689692        Assert.IsTrue(x.Message.Contains("incompatible"));
    690693      }
     
    695698        d = new Deserializer(XmlParser.ParseTypeCache(new StringReader(newTypeString)));
    696699        Assert.Fail("Exception expected");
    697       } catch (PersistenceException x) {
     700      }
     701      catch (PersistenceException x) {
    698702        Assert.IsTrue(x.Message.Contains("newer"));
    699703      }
     
    862866        ExplodingDefaultConstructor newX = (ExplodingDefaultConstructor)XmlParser.Deserialize(tempFile);
    863867        Assert.Fail("Exception expected");
    864       } catch (PersistenceException pe) {
     868      }
     869      catch (PersistenceException pe) {
    865870        Assert.AreEqual(pe.InnerException.Message, "this constructor will always fail");
    866871      }
     
    873878        XmlGenerator.Serialize(ns, tempFile);
    874879        Assert.Fail("PersistenceException expected");
    875       } catch (PersistenceException x) {
     880      }
     881      catch (PersistenceException x) {
    876882        Assert.IsTrue(x.Message.Contains(new StorableSerializer().JustifyRejection(typeof(NonSerializable))));
    877883      }
Note: See TracChangeset for help on using the changeset viewer.