Browse Source

Failed assertions now fail unit tests.

newNRvisualizers
Mike Krüger 14 years ago
parent
commit
ed86963b5a
  1. 7
      ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionAccessibleTests.cs
  2. 7
      ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionBugTests.cs
  3. 2
      ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionCSharpTests.cs
  4. 2
      ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeComplteionOperatorTests.cs
  5. 2
      ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/ParameterCompletionTests.cs
  6. 73
      ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/TestBase.cs
  7. 1
      ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj

7
ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionAccessibleTests.cs

@ -28,12 +28,15 @@ @@ -28,12 +28,15 @@
using System;
using NUnit.Framework;
using System.Diagnostics;
namespace ICSharpCode.NRefactory.CSharp.CodeCompletion
{
[TestFixture()]
public class CodeCompletionAccessibleTests
[TestFixture]
public class CodeCompletionAccessibleTests : TestBase
{
static string testClass = @"
using System;

7
ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionBugTests.cs

@ -35,16 +35,13 @@ using ICSharpCode.NRefactory.Completion; @@ -35,16 +35,13 @@ using ICSharpCode.NRefactory.Completion;
using System.Linq;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.Editor;
using System.Diagnostics;
namespace ICSharpCode.NRefactory.CSharp.CodeCompletion
{
[TestFixture()]
public class CodeCompletionBugTests
public class CodeCompletionBugTests : TestBase
{
static int pcount = 0;

2
ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionCSharpTests.cs

@ -32,7 +32,7 @@ using NUnit.Framework; @@ -32,7 +32,7 @@ using NUnit.Framework;
namespace ICSharpCode.NRefactory.CSharp.CodeCompletion
{
[TestFixture()]
public class CodeCompletionCSharpTests
public class CodeCompletionCSharpTests : TestBase
{
[Test()]
public void TestUsingDeclaration ()

2
ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeComplteionOperatorTests.cs

@ -32,7 +32,7 @@ using NUnit.Framework; @@ -32,7 +32,7 @@ using NUnit.Framework;
namespace ICSharpCode.NRefactory.CSharp.CodeCompletion
{
[TestFixture()]
public class CodeCompletionOperatorTests
public class CodeCompletionOperatorTests : TestBase
{
[Test()]
public void TestAddOperator ()

2
ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/ParameterCompletionTests.cs

@ -39,7 +39,7 @@ using System.Linq; @@ -39,7 +39,7 @@ using System.Linq;
namespace ICSharpCode.NRefactory.CSharp.CodeCompletion
{
[TestFixture()]
public class ParameterCompletionTests
public class ParameterCompletionTests : TestBase
{
class TestFactory : IParameterCompletionDataFactory
{

73
ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/TestBase.cs

@ -0,0 +1,73 @@ @@ -0,0 +1,73 @@
//
// TestBase.cs
//
// Author:
// Mike Krüger <mkrueger@xamarin.com>
//
// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using NUnit.Framework;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
using ICSharpCode.NRefactory.CSharp.Completion;
using ICSharpCode.NRefactory.Completion;
using System.Linq;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.Editor;
using System.Diagnostics;
namespace ICSharpCode.NRefactory.CSharp.CodeCompletion
{
[TestFixture]
public class TestBase
{
class TestListener : TraceListener
{
public override void Fail (string message)
{
throw new Exception ("Assertion failed:"+ message);
}
public override void Write (string o)
{
Console.Write (o);
}
public override void WriteLine (string o)
{
Console.WriteLine (o);
}
}
TestListener listener = new TestListener ();
[TestFixtureSetUp]
public void FixtureSetUp ()
{
System.Diagnostics.Debug.Listeners.Add (listener);
}
[TestFixtureTearDown]
public void FixtureTearDown ()
{
System.Diagnostics.Debug.Listeners.Remove (listener);
}
}
}

1
ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj

@ -194,6 +194,7 @@ @@ -194,6 +194,7 @@
<Compile Include="CSharp\CodeCompletion\CodeComplteionOperatorTests.cs" />
<Compile Include="CSharp\CodeCompletion\CompletionDataList.cs" />
<Compile Include="CSharp\CodeCompletion\ParameterCompletionTests.cs" />
<Compile Include="CSharp\CodeCompletion\TestBase.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj">

Loading…
Cancel
Save