Skip to content

Commit

Permalink
let resharper do his cleanup task :-)
Browse files Browse the repository at this point in the history
and optimze some code
  • Loading branch information
lformella committed Nov 12, 2012
1 parent 43e41a9 commit d0036e5
Show file tree
Hide file tree
Showing 81 changed files with 2,941 additions and 2,534 deletions.
2 changes: 1 addition & 1 deletion Core.Test/Core.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="nunit.framework, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" />
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
Expand Down
25 changes: 6 additions & 19 deletions Core.Test/Helper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Helper.cs
//
//
// Author:
// Lars Formella <ich@larsformella.de>
//
Expand All @@ -15,35 +15,23 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//

using System;

#if !WINDOWS
using NUnit.Framework;
#else
using Microsoft.VisualStudio.TestTools.UnitTesting;
#endif

namespace XG.Core.Test
{
#if !WINDOWS
[TestFixture()]
#else
[TestClass]
#endif
[TestFixture]
public class Helper
{
#if !WINDOWS
[Test()]
#else
[TestMethod]
#endif
public void ShrinkFileName ()
[Test]
public void ShrinkFileName()
{
string fileName = "This_(is).-an_Evil)(File-_-name_[Test].txt";
Int64 fileSize = 440044;
Expand All @@ -53,4 +41,3 @@ public void ShrinkFileName ()
}
}
}

36 changes: 10 additions & 26 deletions Core.Test/Object.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Object.cs
//
//
// Author:
// Lars Formella <ich@larsformella.de>
//
Expand All @@ -15,43 +15,28 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//

using System;

#if !WINDOWS
using NUnit.Framework;
#else
using Microsoft.VisualStudio.TestTools.UnitTesting;
#endif

namespace XG.Core.Test
{
#if !WINDOWS
[TestFixture()]
#else
[TestClass]
#endif
[TestFixture]
public class Object
{
bool _modified = false;
bool _modified;

#if !WINDOWS
[Test()]
#else
[TestMethod]
#endif
public void Test ()
[Test]
public void Test()
{
Core.Object obj = new Core.Object();
obj.Changed += delegate
{
_modified = true;
};
obj.Changed += delegate { _modified = true; };
AssertModified(obj, false);

obj.Name = "Test";
Expand All @@ -78,9 +63,8 @@ public void Test ()
void AssertModified(AObject aObject, bool modified)
{
aObject.Commit();
Assert.AreEqual(this._modified, modified);
this._modified = false;
Assert.AreEqual(_modified, modified);
_modified = false;
}
}
}

35 changes: 10 additions & 25 deletions Core.Test/Objects.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Objects.cs
//
//
// Author:
// Lars Formella <ich@larsformella.de>
//
Expand All @@ -15,42 +15,28 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//

using System;

#if !WINDOWS
using NUnit.Framework;
#else
using Microsoft.VisualStudio.TestTools.UnitTesting;
#endif

namespace XG.Core.Test
{
#if !WINDOWS
[TestFixture()]
#else
[TestClass]
#endif
[TestFixture]
public class Objects
{
bool _childAdded = false;
bool _childAdded;

#if !WINDOWS
[Test()]
#else
[TestMethod]
#endif
public void Test ()
[Test]
public void Test()
{
Core.Objects parent = new Core.Objects();
parent.Added += delegate {
_childAdded = true;
};
parent.Added += delegate { _childAdded = true; };
parent.Guid = Guid.NewGuid();

AssertChildAdded(false);
Expand All @@ -65,9 +51,8 @@ public void Test ()

void AssertChildAdded(bool childAdded)
{
Assert.AreEqual(this._childAdded, childAdded);
this._childAdded = false;
Assert.AreEqual(_childAdded, childAdded);
_childAdded = false;
}
}
}

30 changes: 28 additions & 2 deletions Core.Test/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// AssemblyInfo.cs
//
// Author:
// Lars Formella <ich@larsformella.de>
//
// Copyright (c) 2012 Lars Formella
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//

using System.Reflection;
using System.Runtime.InteropServices;

// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.

[assembly: AssemblyTitle("Core.Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
Expand All @@ -17,9 +40,11 @@
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.

[assembly: ComVisible(false)]

// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird

[assembly: Guid("83ca873b-cc1c-4498-a5c5-61c1df3b548c")]

// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
Expand All @@ -31,5 +56,6 @@
//
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" wie folgt verwenden:

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Loading

0 comments on commit d0036e5

Please sign in to comment.