forked from sdekock/AgUnit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved test logging, first steps for XUnit / NUnit compatibility.
- Loading branch information
Steven De Kock
committed
Jul 23, 2011
1 parent
51577a4
commit 2dd6932
Showing
23 changed files
with
659 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ | |
*.user | ||
_ReSharper.*/ | ||
output/* | ||
resharper.log | ||
TestResults/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...gUnit.Runner.Resharper60.TaskRunner/UnitTestProvider/MSTest/MsTestAssemblyTaskProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using AgUnit.Runner.Resharper60.TaskRunner.UnitTestRunner.Silverlight.Providers; | ||
using JetBrains.ReSharper.TaskRunnerFramework; | ||
using JetBrains.ReSharper.UnitTestRunner.MSTest; | ||
|
||
namespace AgUnit.Runner.Resharper60.TaskRunner.UnitTestProvider.MSTest | ||
{ | ||
public class MsTestAssemblyTaskProvider : IAssemblyTaskProvider | ||
{ | ||
public bool IsAssemblyTask(RemoteTask task) | ||
{ | ||
return task is MsTestTestAssemblyTask; | ||
} | ||
|
||
private MsTestTestAssemblyTask GetTask(RemoteTask task) | ||
{ | ||
return (MsTestTestAssemblyTask)task; | ||
} | ||
|
||
public string GetXapPath(RemoteTask task) | ||
{ | ||
var assemblyTask = GetTask(task); | ||
|
||
return assemblyTask.AssemblyLocation.Replace(".dll", ".xap"); // TODO: Find a way to get this from the project settings. | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/AgUnit.Runner.Resharper60.TaskRunner/UnitTestProvider/MSTest/MsTestClassTaskProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using AgUnit.Runner.Resharper60.TaskRunner.UnitTestRunner.Silverlight.Providers; | ||
using JetBrains.ReSharper.TaskRunnerFramework; | ||
using JetBrains.ReSharper.UnitTestRunner.MSTest; | ||
|
||
namespace AgUnit.Runner.Resharper60.TaskRunner.UnitTestProvider.MSTest | ||
{ | ||
public class MsTestClassTaskProvider : IClassTaskProvider | ||
{ | ||
public bool IsClassTask(RemoteTask task) | ||
{ | ||
return task is MsTestTestClassTask; | ||
} | ||
|
||
private MsTestTestClassTask GetTask(RemoteTask task) | ||
{ | ||
return (MsTestTestClassTask)task; | ||
} | ||
|
||
public string GetFullClassName(RemoteTask task) | ||
{ | ||
var classTask = GetTask(task); | ||
|
||
return classTask.TypeName; | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/AgUnit.Runner.Resharper60.TaskRunner/UnitTestProvider/MSTest/MsTestMethodTaskProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using AgUnit.Runner.Resharper60.TaskRunner.UnitTestRunner.Silverlight.Providers; | ||
using JetBrains.ReSharper.TaskRunnerFramework; | ||
using JetBrains.ReSharper.UnitTestRunner.MSTest; | ||
|
||
namespace AgUnit.Runner.Resharper60.TaskRunner.UnitTestProvider.MSTest | ||
{ | ||
public class MsTestMethodTaskProvider : IMethodTaskProvider | ||
{ | ||
public bool IsMethodTask(RemoteTask task) | ||
{ | ||
return task is MsTestTestMethodTask; | ||
} | ||
|
||
private MsTestTestMethodTask GetTask(RemoteTask task) | ||
{ | ||
return (MsTestTestMethodTask)task; | ||
} | ||
|
||
public string GetFullMethodName(RemoteTask task) | ||
{ | ||
var methodTask = GetTask(task); | ||
|
||
return string.Format("{0}.{1}", methodTask.TypeName, methodTask.ShortName); | ||
} | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
src/AgUnit.Runner.Resharper60.TaskRunner/UnitTestRunner/Silverlight/DebugLogger.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
using StatLight.Core.Common; | ||
using StatLight.Core.Properties; | ||
|
||
namespace AgUnit.Runner.Resharper60.TaskRunner.UnitTestRunner.Silverlight | ||
{ | ||
// TODO: Move this to StatLight | ||
public class DebugLogger : LoggerBase | ||
{ | ||
private readonly Settings settings; | ||
|
||
public DebugLogger() | ||
: this(LogChatterLevels.Error | LogChatterLevels.Warning | LogChatterLevels.Information, Settings.Default) | ||
{ } | ||
|
||
public DebugLogger(LogChatterLevels logChatterLevel) | ||
: this(logChatterLevel, Settings.Default) | ||
{ } | ||
|
||
public DebugLogger(LogChatterLevels logChatterLevel, Settings settings) | ||
: base(logChatterLevel) | ||
{ | ||
this.settings = settings; | ||
} | ||
|
||
public override void Information(string message) | ||
{ | ||
if (ShouldLog(LogChatterLevels.Information)) | ||
Write(message, "Information", false); | ||
} | ||
|
||
public override void Debug(string message) | ||
{ | ||
if (ShouldLog(LogChatterLevels.Debug)) | ||
Write(message, "Debug", true); | ||
} | ||
|
||
public override void Debug(string message, bool writeNewLine) | ||
{ | ||
if (ShouldLog(LogChatterLevels.Debug)) | ||
Write(message, "Debug", writeNewLine); | ||
} | ||
|
||
public override void Warning(string message) | ||
{ | ||
if (ShouldLog(LogChatterLevels.Warning)) | ||
Write(message, "Warning", false); | ||
} | ||
|
||
public override void Error(string message) | ||
{ | ||
if (ShouldLog(LogChatterLevels.Error)) | ||
Write(message, "Error", true); | ||
} | ||
|
||
private void Write(string message, string type, bool useNewLine) | ||
{ | ||
message = string.Format("[{0}]: {1}", type, message); | ||
|
||
if (useNewLine) | ||
{ | ||
System.Diagnostics.Debug.WriteLine(message); | ||
} | ||
else | ||
{ | ||
System.Diagnostics.Debug.Write(message); | ||
} | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...AgUnit.Runner.Resharper60.TaskRunner/UnitTestRunner/Silverlight/Execution/AssemblyTask.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using AgUnit.Runner.Resharper60.TaskRunner.UnitTestRunner.Silverlight.Providers; | ||
|
||
namespace AgUnit.Runner.Resharper60.TaskRunner.UnitTestRunner.Silverlight.Execution | ||
{ | ||
public class AssemblyTask | ||
{ | ||
public TaskNode Node { get; private set; } | ||
public IAssemblyTaskProvider AssemblyTaskProvider { get; private set; } | ||
|
||
public AssemblyTask(TaskNode node, IAssemblyTaskProvider assemblyTaskProvider) | ||
{ | ||
Node = node; | ||
AssemblyTaskProvider = assemblyTaskProvider; | ||
} | ||
|
||
public void Execute(Action<AssemblyTask> execute) | ||
{ | ||
Node.Execute(execute, this); | ||
} | ||
|
||
public string GetXapPath() | ||
{ | ||
return AssemblyTaskProvider.GetXapPath(Node.Task); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/AgUnit.Runner.Resharper60.TaskRunner/UnitTestRunner/Silverlight/Execution/ClassTask.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using AgUnit.Runner.Resharper60.TaskRunner.UnitTestRunner.Silverlight.Providers; | ||
|
||
namespace AgUnit.Runner.Resharper60.TaskRunner.UnitTestRunner.Silverlight.Execution | ||
{ | ||
public class ClassTask | ||
{ | ||
public TaskNode Node { get; private set; } | ||
public IClassTaskProvider ClassTaskProvider { get; private set; } | ||
|
||
public ClassTask(TaskNode node, IClassTaskProvider classTaskProvider) | ||
{ | ||
Node = node; | ||
ClassTaskProvider = classTaskProvider; | ||
} | ||
|
||
public string GetFullClassName() | ||
{ | ||
return ClassTaskProvider.GetFullClassName(Node.Task); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/AgUnit.Runner.Resharper60.TaskRunner/UnitTestRunner/Silverlight/Execution/MethodTask.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using AgUnit.Runner.Resharper60.TaskRunner.UnitTestRunner.Silverlight.Providers; | ||
|
||
namespace AgUnit.Runner.Resharper60.TaskRunner.UnitTestRunner.Silverlight.Execution | ||
{ | ||
public class MethodTask | ||
{ | ||
public TaskNode Node { get; private set; } | ||
public IMethodTaskProvider MethodTaskProvider { get; private set; } | ||
|
||
public MethodTask(TaskNode node, IMethodTaskProvider methodTaskProvider) | ||
{ | ||
Node = node; | ||
MethodTaskProvider = methodTaskProvider; | ||
} | ||
|
||
public string GetFullMethodName() | ||
{ | ||
return MethodTaskProvider.GetFullMethodName(Node.Task); | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...nit.Runner.Resharper60.TaskRunner/UnitTestRunner/Silverlight/Execution/TaskEnvironment.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Collections.Generic; | ||
using AgUnit.Runner.Resharper60.TaskRunner.UnitTestRunner.Silverlight.Providers; | ||
using JetBrains.ReSharper.TaskRunnerFramework; | ||
|
||
namespace AgUnit.Runner.Resharper60.TaskRunner.UnitTestRunner.Silverlight.Execution | ||
{ | ||
public class TaskEnvironment | ||
{ | ||
public IRemoteTaskServer Server { get; private set; } | ||
public IEnumerable<IAssemblyTaskProvider> AssemblyTaskProviders { get; private set; } | ||
public IEnumerable<IClassTaskProvider> ClassTaskProviders { get; private set; } | ||
public IEnumerable<IMethodTaskProvider> MethodTaskProviders { get; private set; } | ||
|
||
public TaskEnvironment(IRemoteTaskServer server, | ||
IEnumerable<IAssemblyTaskProvider> assemblyTaskProviders, | ||
IEnumerable<IClassTaskProvider> classTaskProviders, | ||
IEnumerable<IMethodTaskProvider> methodTaskProviders) | ||
{ | ||
Server = server; | ||
AssemblyTaskProviders = assemblyTaskProviders; | ||
ClassTaskProviders = classTaskProviders; | ||
MethodTaskProviders = methodTaskProviders; | ||
} | ||
} | ||
} |
Oops, something went wrong.