mirror of
https://github.com/wagesj45/cs-mic.git
synced 2025-08-03 08:08:24 -05:00
Migrating from Sourceforge to Codeplex. Initial checkin starting with version 1.1.5.0 source code.
This commit is contained in:
parent
f7165325f7
commit
c41167bfc4
44 changed files with 7608 additions and 0 deletions
136
CS-MIC/csmic/CSMICTests/AuthoringTests.txt
Normal file
136
CS-MIC/csmic/CSMICTests/AuthoringTests.txt
Normal file
|
@ -0,0 +1,136 @@
|
|||
==========================================================================
|
||||
Visual Studio Team System: Overview of Authoring and Running Tests
|
||||
==========================================================================
|
||||
|
||||
This overview describes the features for authoring and running tests in
|
||||
Visual Studio Team System and Visual Studio Team Edition for Software Testers.
|
||||
|
||||
Opening Tests
|
||||
-------------
|
||||
To open a test, open a test project or a test metadata file (a file with
|
||||
extension .vsmdi) that contains the definition of the test. You can find
|
||||
test projects and metadata files in Solution Explorer.
|
||||
|
||||
Viewing Tests
|
||||
-------------
|
||||
To see which tests are available to you, open the Test View window. Or,
|
||||
if you have installed Team Edition for Software Testers, you can also open
|
||||
the Test List Editor window to view tests.
|
||||
|
||||
To open the Test View window, click the Test menu, point to Windows, and
|
||||
then click Test View. To open the Test List Editor window (if you have
|
||||
installed Team Edition for Software Testers), click Test, point to Windows,
|
||||
and then click Test List Editor.
|
||||
|
||||
Running Tests
|
||||
-------------
|
||||
You can run tests from the Test View window and the Test List Editor window.
|
||||
See Viewing Tests to learn how to open these windows. To run one or more
|
||||
tests displayed in the Test View window, first select the tests in that
|
||||
window; to select multiple tests, hold either the Shift or CTRL key while
|
||||
clicking tests. Then click the Run Tests button in the Test View window
|
||||
toolbar.
|
||||
|
||||
If you have installed Visual Studio Team Edition for Software Testers, you can
|
||||
also use the Test List Editor window to run tests. To run tests in Test List Editor,
|
||||
select the check box next to each test that you want to run. Then click the
|
||||
Run Tests button in the Test List Editor window toolbar.
|
||||
|
||||
Viewing Test Results
|
||||
--------------------
|
||||
When you run a test or a series of tests, the results of the test run will be
|
||||
shown in the Test Results window. Each individual test in the run is shown on
|
||||
a separate line so that you can see its status. The window contains an
|
||||
embedded status bar in the top half of the window that provides you with
|
||||
summary details of the complete test run.
|
||||
|
||||
To see more detailed results for a particular test result, double-click it in
|
||||
the Test Results window. This opens a window that provides more information
|
||||
about the particular test result, such as any specific error messages returned
|
||||
by the test.
|
||||
|
||||
Changing the way that tests are run
|
||||
-----------------------------------
|
||||
Each time you run one or more tests, a collection of settings is used to
|
||||
determine how those tests are run. These settings are contained in a “test
|
||||
run configuration” file.
|
||||
|
||||
Here is a partial list of the changes you can make with a test run
|
||||
configuration file:
|
||||
|
||||
- Change the naming scheme for each test run.
|
||||
- Change the test controller that the tests are run on so that you can run
|
||||
tests remotely.
|
||||
- Gather code coverage data for the code being tested so that you can see
|
||||
which lines of code are covered by your tests.
|
||||
- Enable and disable test deployment.
|
||||
- Specify additional files to deploy before tests are run.
|
||||
- Select a different host, ASP.NET, for running ASP.NET unit tests.
|
||||
- Select a different host, the smart device test host, for running smart device unit tests.
|
||||
- Set various properties for the test agents that run your tests.
|
||||
- Run custom scripts at the start and end of each test run so that you can
|
||||
set up the test environment exactly as required each time tests are run.
|
||||
- Set time limits for tests and test runs.
|
||||
- Set the browser mix and the number of times to repeat Web tests in the
|
||||
test run.
|
||||
|
||||
By default, a test run configuration file is created whenever you create a
|
||||
new test project. You make changes to this file by double-clicking it in
|
||||
Solution Explorer and then changing its settings. (Test run configuration
|
||||
files have the extension .testrunconfig.)
|
||||
|
||||
A solution can contain multiple test run configuration files. Only one of
|
||||
those files, known as the “Active” test run configuration file, is used to
|
||||
determine the settings that are currently used for test runs. You select
|
||||
the active test run configuration by clicking Select Active Test Run
|
||||
Configuration on the Test menu.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Test Types
|
||||
----------
|
||||
Using Visual Studio Team Edition for Software Testers, you can create a number
|
||||
of different test types:
|
||||
|
||||
Unit test: Use a unit test to create a programmatic test in C++, Visual C# or
|
||||
Visual Basic that exercises source code. A unit test calls the methods of a
|
||||
class, passing suitable parameters, and verifies that the returned value is
|
||||
what you expect.
|
||||
There are three specialized variants of unit tests:
|
||||
- Data-driven unit tests are created when you configure a unit test to be
|
||||
called repeatedly for each row of a data source. The data from each row
|
||||
is used by the unit test as input data.
|
||||
- ASP.NET unit tests are unit tests that exercise code in an ASP.NET Web
|
||||
application.
|
||||
- Smart device unit tests are unit tests that are deployed to a smart device
|
||||
or emulator and then executed by the smart device test host.
|
||||
|
||||
Web Test: Web tests consist of an ordered series of HTTP requests that you
|
||||
record in a browser session using Microsoft Internet Explorer. You can have
|
||||
the test report specific details about the pages or sites it requests, such
|
||||
as whether a particular page contains a specified string.
|
||||
|
||||
Load Test: You use a load test to encapsulate non-manual tests, such as
|
||||
unit, Web, and generic tests, and then run them simultaneously by using
|
||||
virtual users. Running these tests under load generates test results,
|
||||
including performance and other counters, in tables and in graphs.
|
||||
|
||||
Generic test: A generic test is an existing program wrapped to function as a
|
||||
test in Visual Studio. The following are examples of tests or programs that
|
||||
you can turn into generic tests:
|
||||
- An existing test that uses process exit codes to communicate whether the
|
||||
test passed or failed. 0 indicates passing and any other value indicates
|
||||
a failure.
|
||||
- A general program to obtain specific functionality during a test scenario.
|
||||
- A test or program that uses a special XML file (called a “summary results
|
||||
file”), to communicate detailed results.
|
||||
|
||||
Manual test: The manual test type is used when the test tasks are to be
|
||||
completed by a test engineer as opposed to an automated script.
|
||||
|
||||
Ordered test: Use an ordered test to execute a set of tests in an order you
|
||||
specify.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
120
CS-MIC/csmic/CSMICTests/CSMICTests.csproj
Normal file
120
CS-MIC/csmic/CSMICTests/CSMICTests.csproj
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{C03AD9DF-630F-4C88-A9D4-8B4B450CCB54}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CSMICTests</RootNamespace>
|
||||
<AssemblyName>CSMICTests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<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="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="InputInterpreterTest.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="AuthoringTests.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\csmic\csmic.csproj">
|
||||
<Project>{7BBA4BA2-E885-4D89-8710-F1A609616B7D}</Project>
|
||||
<Name>csmic</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Shadow Include="Test References\csmic.accessor" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
10
CS-MIC/csmic/CSMICTests/CSMICTests.csproj.vspscc
Normal file
10
CS-MIC/csmic/CSMICTests/CSMICTests.csproj.vspscc
Normal file
|
@ -0,0 +1,10 @@
|
|||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = ""
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
216
CS-MIC/csmic/CSMICTests/InputInterpreterTest.cs
Normal file
216
CS-MIC/csmic/CSMICTests/InputInterpreterTest.cs
Normal file
|
@ -0,0 +1,216 @@
|
|||
using csmic;
|
||||
using csmic.Extensions;
|
||||
using System.Text;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
namespace CSMICTests
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
///This is a test class for InputInterpreterTest and is intended
|
||||
///to contain all InputInterpreterTest Unit Tests
|
||||
///</summary>
|
||||
[TestClass()]
|
||||
public class InputInterpreterTest
|
||||
{
|
||||
|
||||
|
||||
private TestContext testContextInstance;
|
||||
|
||||
/// <summary>
|
||||
///Gets or sets the test context which provides
|
||||
///information about and functionality for the current test run.
|
||||
///</summary>
|
||||
public TestContext TestContext
|
||||
{
|
||||
get
|
||||
{
|
||||
return testContextInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
testContextInstance = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region Additional test attributes
|
||||
//
|
||||
//You can use the following additional attributes as you write your tests:
|
||||
//
|
||||
//Use ClassInitialize to run code before running the first test in the class
|
||||
//[ClassInitialize()]
|
||||
//public static void MyClassInitialize(TestContext testContext)
|
||||
//{
|
||||
//}
|
||||
//
|
||||
//Use ClassCleanup to run code after all tests in a class have run
|
||||
//[ClassCleanup()]
|
||||
//public static void MyClassCleanup()
|
||||
//{
|
||||
//}
|
||||
//
|
||||
//Use TestInitialize to run code before running each test
|
||||
//[TestInitialize()]
|
||||
//public void MyTestInitialize()
|
||||
//{
|
||||
//}
|
||||
//
|
||||
//Use TestCleanup to run code after each test has run
|
||||
//[TestCleanup()]
|
||||
//public void MyTestCleanup()
|
||||
//{
|
||||
//}
|
||||
//
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
///A test for Interpret
|
||||
///</summary>
|
||||
[TestMethod()]
|
||||
public void InterpretTest()
|
||||
{
|
||||
InputInterpreter target = new InputInterpreter();
|
||||
target.CodedFunctions.Add(CodedFunctionFactory.Create("addfive", 1, rf => rf[0] + 5));
|
||||
|
||||
//HighLoadTest(target, "+1");
|
||||
//HighLoadTest(target, "+sin(1)");
|
||||
//HighLoadTest(target, "+precision(0.123456789, 7)");
|
||||
//HighLoadTest(target, "+2*(2 + 5)/tan(sin(4))");
|
||||
//HighLoadTest(target, "+2*2/3-1.23456");
|
||||
|
||||
ExpressionDecimalTest(target, "2+2", 4);
|
||||
ExpressionDecimalTest(target, "1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10", 55);
|
||||
ExpressionDecimalTest(target, "4 + 2 / 1 - 3 * 2", 0);
|
||||
ExpressionDecimalTest(target, "16*2 - 2*3", 26);
|
||||
ExpressionDecimalTest(target, "7-6+3*2", 7);
|
||||
ExpressionDecimalTest(target, "1/-2*-1", 0.5M);
|
||||
ExpressionDecimalTest(target, "12 + 26 / -2 + 3", 2);
|
||||
ExpressionDecimalTest(target, "0.02395/1000", 0.00002395M);
|
||||
ExpressionDecimalTest(target, "0100010101b", 277);
|
||||
ExpressionDecimalTest(target, "0xabcdef", 11259375);
|
||||
ExpressionDecimalTest(target, "11111111b + 0xFF", 510);
|
||||
ExpressionDecimalTest(target, "10011001b * 0x01bAc", 1083852);
|
||||
|
||||
ExpressionDecimalTest(target, "log(sin(((25*200) - 5000)^1943),2)", decimal.MinValue);
|
||||
ExpressionDecimalTest(target, "log(cos(((25*200) - 5000)^1943),2)", 0);
|
||||
ExpressionDecimalTest(target, "cos(2^3)", -0.145500033808614M);
|
||||
ExpressionDecimalTest(target, "addfive(30)", 35);
|
||||
ExpressionDecimalTest(target, "precision(1.23456789, 4)", 1.2346M);
|
||||
ExpressionDecimalTest(target, "3000 * (log(1 + 3162, 2))", 34881.2335215522M);
|
||||
ExpressionDecimalTest(target, "(((12)))", 12);
|
||||
|
||||
ExpressionOutputTest(target, "z := (3*x) - (2*y)", "(3*x)-(2*y)");
|
||||
ExpressionOutputTest(target, "x :: 3", "3");
|
||||
ExpressionOutputTest(target, "y :: 2", "2");
|
||||
ExpressionOutputTest(target, "x", "3");
|
||||
ExpressionOutputTest(target, "y", "2");
|
||||
ExpressionOutputTest(target, "z", "5");
|
||||
ExpressionOutputTest(target, "z + 2", "7");
|
||||
ExpressionOutputTest(target, "y :: 3", "3");
|
||||
ExpressionOutputTest(target, "z", "3");
|
||||
ExpressionOutputTest(target, "arr -> [3,6,9,12]", "3,6,9,12");
|
||||
ExpressionOutputTest(target, "arr[1]", "6");
|
||||
ExpressionOutputTest(target, "arr[1+1]", "9");
|
||||
ExpressionOutputTest(target, "arr[2+44]", "0");
|
||||
|
||||
ExpressionOutputTest(target, "log(sin(((25*200) - 5000)^1943),2)", "log(sin(((25*200) - 5000)^1943),2)".Interpret());
|
||||
ExpressionOutputTest(target, "log(cos(((25*200) - 5000)^1943),2)", "log(cos(((25*200) - 5000)^1943),2)".Interpret());
|
||||
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AsyncTest()
|
||||
{
|
||||
InputInterpreter interpreter = new InputInterpreter();
|
||||
interpreter.InterpretAsync("2 + 2", i =>
|
||||
{
|
||||
Assert.IsTrue(i.Output == "4");
|
||||
});
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ComputableTest()
|
||||
{
|
||||
InputInterpreter interpreter = new InputInterpreter();
|
||||
|
||||
interpreter.Interpret("1");
|
||||
Assert.IsTrue(interpreter.AsComputable(c => c.Add(5)).Resolve().Decimal == 6);
|
||||
Assert.IsTrue(interpreter.AsComputable(c => c.Subtract(5)).Resolve().Decimal == 1);
|
||||
Assert.IsTrue(interpreter.AsComputable(c => c.Multiply(5)).Resolve().Decimal == 5);
|
||||
Assert.IsTrue(interpreter.AsComputable(c => c.Divide(1)).Resolve().Decimal == 5);
|
||||
Assert.IsTrue(interpreter.AsComputable(c => c.Mod(1)).Resolve().Decimal == 0);
|
||||
Assert.IsTrue(interpreter.AsComputable(c => c.RaiseToPower(5)).Resolve().Decimal == 0);
|
||||
|
||||
interpreter.Interpret("1");
|
||||
Assert.IsTrue(interpreter.ToComputable().Add(5).Resolve().Decimal == 6);
|
||||
Assert.IsTrue(interpreter.ToComputable().Subtract(5).Resolve().Decimal == 1);
|
||||
Assert.IsTrue(interpreter.ToComputable().Multiply(5).Resolve().Decimal == 5);
|
||||
Assert.IsTrue(interpreter.ToComputable().Divide(1).Resolve().Decimal == 5);
|
||||
Assert.IsTrue(interpreter.ToComputable().Mod(1).Resolve().Decimal == 0);
|
||||
Assert.IsTrue(interpreter.ToComputable().RaiseToPower(5).Resolve().Decimal == 0);
|
||||
|
||||
interpreter.Interpret("1");
|
||||
Assert.IsTrue(interpreter.AsComputable(c => c.Add(5)).ResolveTo(i => i.Decimal) == 6);
|
||||
Assert.IsTrue(interpreter.AsComputable(c => c.Subtract(5)).ResolveTo(i => i.Int) == 1);
|
||||
|
||||
interpreter.Interpret("5");
|
||||
int[] ia = new int[] { 1,2,3 };
|
||||
var test = interpreter.AsComputable(computable => computable.ForAll(ia, sub => sub.RaiseToPower)).Resolve();
|
||||
Assert.IsTrue(test.Output == "15625");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests a value repeated 10,000 times and checks for an execution time less than 200 milliseconds.
|
||||
/// </summary>
|
||||
/// <param name="target">The input interpreter.</param>
|
||||
/// <param name="value">The value to repeat and test.</param>
|
||||
public void HighLoadTest(InputInterpreter target, string value)
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
string input = string.Empty;
|
||||
System.TimeSpan baseTime = new System.TimeSpan();
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
builder.Append(value);
|
||||
}
|
||||
input = builder.ToString();
|
||||
target.Interpret(input);
|
||||
baseTime = target.LastExecutionTime;
|
||||
|
||||
builder = new StringBuilder();
|
||||
for (int i = 0; i < 100000; i++)
|
||||
{
|
||||
builder.Append(value);
|
||||
}
|
||||
input = builder.ToString();
|
||||
target.Interpret(input);
|
||||
|
||||
Assert.IsTrue(target.LastExecutionTime <= System.TimeSpan.FromTicks((baseTime.Ticks + 1 * 100) + 100), string.Format("{0} failed the high load test.", value));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests a given expression for a decimal result.
|
||||
/// </summary>
|
||||
/// <param name="target">The input interpreter.</param>
|
||||
/// <param name="input">The input to execute.</param>
|
||||
/// <param name="expected">The expected value.</param>
|
||||
public void ExpressionDecimalTest(InputInterpreter target, string input, decimal expected)
|
||||
{
|
||||
target.Interpret(input);
|
||||
Assert.AreEqual(expected, target.Decimal, string.Format("{0} returned {1} but {2} was expected.", input, target.Decimal, expected));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests a given expression for a string result.
|
||||
/// </summary>
|
||||
/// <param name="target">The input interpreter.</param>
|
||||
/// <param name="input">The input to execute.</param>
|
||||
/// <param name="expected">The expected value.</param>
|
||||
public void ExpressionOutputTest(InputInterpreter target, string input, string expected)
|
||||
{
|
||||
target.Interpret(input);
|
||||
Assert.AreEqual(expected, target.Output, string.Format("{0} returned {1} but {2} was expected.", input, target.Decimal, expected));
|
||||
}
|
||||
}
|
||||
}
|
35
CS-MIC/csmic/CSMICTests/Properties/AssemblyInfo.cs
Normal file
35
CS-MIC/csmic/CSMICTests/Properties/AssemblyInfo.cs
Normal file
|
@ -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("CSMICTests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CSMICTests")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2010")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM componenets. 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("8e6bded0-27ba-4d6b-a785-988958ca4b10")]
|
||||
|
||||
// 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")]
|
2
CS-MIC/csmic/CSMICTests/Test References/csmic.accessor
Normal file
2
CS-MIC/csmic/CSMICTests/Test References/csmic.accessor
Normal file
|
@ -0,0 +1,2 @@
|
|||
csmic.dll
|
||||
Desktop
|
Loading…
Add table
Add a link
Reference in a new issue