-
Notifications
You must be signed in to change notification settings - Fork 750
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Runtime for Silverlight (using MsTest and the Silverlight Unit Testin…
…g Framework) created.
- Loading branch information
unknown
committed
Jun 16, 2010
1 parent
7b69438
commit 13e0300
Showing
38 changed files
with
1,147 additions
and
84 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
23 changes: 23 additions & 0 deletions
23
Runtime.Silverlight/Compatibility/ConfigurationErrorsException.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,23 @@ | ||
using System; | ||
using System.Net; | ||
using System.Runtime.Serialization; | ||
|
||
|
||
namespace System.Configuration | ||
{ | ||
public class ConfigurationErrorsException : Exception | ||
{ | ||
public ConfigurationErrorsException() | ||
{ | ||
} | ||
|
||
public ConfigurationErrorsException(string message) : base(message) | ||
{ | ||
} | ||
|
||
public ConfigurationErrorsException(string message, Exception inner) | ||
: base(message, inner) | ||
{ | ||
} | ||
} | ||
} |
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,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace TechTalk.SpecFlow.Compatibility | ||
{ | ||
internal static class CultureInfoHelper | ||
{ | ||
public static CultureInfo GetCultureInfo(string cultureName) | ||
{ | ||
return new CultureInfo(cultureName); | ||
} | ||
} | ||
} |
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,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Text; | ||
|
||
namespace TechTalk.SpecFlow.Compatibility | ||
{ | ||
internal static class EnumHelper | ||
{ | ||
public static Array GetValues(Type enumType) | ||
{ | ||
if (!enumType.IsEnum) | ||
{ | ||
throw new ArgumentException("Type '" + enumType.Name + "' is not an enum"); | ||
} | ||
|
||
var values = new List<object>(); | ||
|
||
var fields = from field in enumType.GetFields() | ||
where field.IsLiteral | ||
select field; | ||
|
||
foreach (FieldInfo field in fields) | ||
{ | ||
object value = field.GetValue(enumType); | ||
values.Add(value); | ||
} | ||
|
||
return values.ToArray(); | ||
} | ||
} | ||
} |
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,113 @@ | ||
using System; | ||
|
||
namespace System.Diagnostics | ||
{ | ||
/// <summary> | ||
/// Stopwatch is used to measure the general performance of Silverlight functionality. Silverlight | ||
/// does not currently provide a high resolution timer as is available in many operating systems, | ||
/// so the resolution of this timer is limited to milliseconds. This class is best used to measure | ||
/// the relative performance of functions over many iterations. | ||
/// </summary> | ||
public sealed class Stopwatch | ||
{ | ||
private long _startTick; | ||
private long _elapsed; | ||
private bool _isRunning; | ||
|
||
/// <summary> | ||
/// Creates a new instance of the class and starts the watch immediately. | ||
/// </summary> | ||
/// <returns>An instance of Stopwatch, running.</returns> | ||
public static Stopwatch StartNew() | ||
{ | ||
Stopwatch sw = new Stopwatch(); | ||
sw.Start(); | ||
return sw; | ||
} | ||
|
||
/// <summary> | ||
/// Creates an instance of the Stopwatch class. | ||
/// </summary> | ||
public Stopwatch() { } | ||
|
||
/// <summary> | ||
/// Completely resets and deactivates the timer. | ||
/// </summary> | ||
public void Reset() | ||
{ | ||
_elapsed = 0; | ||
_isRunning = false; | ||
_startTick = 0; | ||
} | ||
|
||
/// <summary> | ||
/// Begins the timer. | ||
/// </summary> | ||
public void Start() | ||
{ | ||
if (!_isRunning) | ||
{ | ||
_startTick = GetCurrentTicks(); | ||
_isRunning = true; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Stops the current timer. | ||
/// </summary> | ||
public void Stop() | ||
{ | ||
if (_isRunning) | ||
{ | ||
_elapsed += GetCurrentTicks() - _startTick; | ||
_isRunning = false; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether the instance is currently recording. | ||
/// </summary> | ||
public bool IsRunning | ||
{ | ||
get { return _isRunning; } | ||
} | ||
|
||
/// <summary> | ||
/// Gets the Elapsed time as a Timespan. | ||
/// </summary> | ||
public TimeSpan Elapsed | ||
{ | ||
get { return TimeSpan.FromMilliseconds(ElapsedMilliseconds); } | ||
} | ||
|
||
/// <summary> | ||
/// Gets the Elapsed time as the total number of milliseconds. | ||
/// </summary> | ||
public long ElapsedMilliseconds | ||
{ | ||
get { return GetCurrentElapsedTicks() / TimeSpan.TicksPerMillisecond; } | ||
} | ||
|
||
/// <summary> | ||
/// Gets the Elapsed time as the total number of ticks (which is faked | ||
/// as Silverlight doesn't have a way to get at the actual "Ticks") | ||
/// </summary> | ||
public long ElapsedTicks | ||
{ | ||
get { return GetCurrentElapsedTicks(); } | ||
} | ||
|
||
private long GetCurrentElapsedTicks() | ||
{ | ||
return (long)(this._elapsed + (IsRunning ? (GetCurrentTicks() - _startTick) : 0)); | ||
} | ||
|
||
private long GetCurrentTicks() | ||
{ | ||
// TickCount: Gets the number of milliseconds elapsed since the system started. | ||
return Environment.TickCount * TimeSpan.TicksPerMillisecond; | ||
} | ||
} | ||
|
||
} | ||
|
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,20 @@ | ||
namespace TechTalk.SpecFlow.Configuration | ||
{ | ||
public static class ConfigDefaults | ||
{ | ||
internal const string FeatureLanguage = "en-US"; | ||
internal const string ToolLanguage = ""; | ||
|
||
internal const string UnitTestProviderName = "MSTestSilverlight"; | ||
|
||
internal const bool DetectAmbiguousMatches = true; | ||
internal const bool StopAtFirstError = false; | ||
internal const MissingOrPendingStepsOutcome MissingOrPendingStepsOutcome = TechTalk.SpecFlow.Configuration.MissingOrPendingStepsOutcome.Inconclusive; | ||
|
||
internal const bool TraceSuccessfulSteps = true; | ||
internal const bool TraceTimings = false; | ||
internal const string MinTracedDuration = "0:0:0.1"; | ||
|
||
internal const bool AllowDebugGeneratedFiles = false; | ||
} | ||
} |
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,35 @@ | ||
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("TechTalk.SpecFlow.Silverlight")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Microsoft")] | ||
[assembly: AssemblyProduct("TechTalk.SpecFlow.Silverlight")] | ||
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// 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("04dec58a-9677-4f58-ae8b-4744bbffb9a9")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Revision and Build Numbers | ||
// by using the '*' as shown below: | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
Oops, something went wrong.