Skip to content

Commit

Permalink
Pulled browser set up out to the calling test
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashank Shetty committed Jan 17, 2012
1 parent 8486396 commit 43012ba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/vsrunnerjs/EnumerableExtensions.cs
Expand Up @@ -9,10 +9,9 @@ public static IEnumerable<T> ForEach<T>(this IEnumerable<T> items, Action<T> act
{
if (items == null)
throw new ArgumentNullException("items", "collection cannot be null");
foreach (T obj in items)
foreach (var obj in items)
action(obj);
return items;
}

}
}
12 changes: 3 additions & 9 deletions src/vsrunnerjs/JSTestRunner.cs
Expand Up @@ -11,15 +11,15 @@ namespace vsrunnerjs
{
public interface IJSTestRunner
{
IEnumerable<JSTest> RunTests(string jsFilePath);
IEnumerable<JSTest> RunTests(string jsFilePath, BrowserSetUp browserSetUp);
}

public class JSTestRunner : IJSTestRunner
{
private readonly List<JSTest> _jSTests = new List<JSTest>();


public IEnumerable<JSTest> RunTests(string jsFilePath)
public IEnumerable<JSTest> RunTests(string jsFilePath, BrowserSetUp browserSetUp)
{
var filesBeingTested =
new List<string> {"*.htm", "*.html"}.SelectMany(
Expand All @@ -42,13 +42,7 @@ public IEnumerable<JSTest> RunTests(string jsFilePath)
{
list.AddRange(actions);
}
var browserSetUp = new BrowserSetUp
{
BaseUrl = "",
UseInternetExplorer = false,
UseFireFox = true,
CloseBrowserAfterEachTest = false
};

var notification = new TestRunner(new BrowserProvider(browserSetUp), browserSetUp).PassesTest(list) ??
new Notification();

Expand Down
7 changes: 5 additions & 2 deletions src/vsrunnerjs/Properties/AssemblyInfo.cs
@@ -1,10 +1,10 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("vsrunnerjs")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
Expand All @@ -17,9 +17,11 @@
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM

[assembly: Guid("d97d9e1e-dec0-4c9b-ae86-541df957f5d9")]

// Version information for an assembly consists of the following four values:
Expand All @@ -32,5 +34,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

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

0 comments on commit 43012ba

Please sign in to comment.