Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 56d64d1e authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

adding testproject to examin functionality in vecto 2.2

parent 49ac4643
No related branches found
No related tags found
No related merge requests found
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über folgende
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("VectoLegacyTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VectoLegacyTests")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Wenn ComVisible auf "false" festgelegt wird, sind die Typen innerhalb dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("25b42ace-0f92-4e46-80b1-12f5927f51f8")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// durch Einsatz von '*', wie in nachfolgendem Beispiel:
// [Assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System;
using System.Diagnostics;
using System.Globalization;
using System.Threading;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using VECTO;
namespace VectoLegacyTests
{
[TestClass]
public class TorqueConverterTest
{
[ClassInitialize]
public static void InitTests(TestContext ctx)
{
if (CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == ".") {
return;
}
try {
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
} catch (Exception ex) {}
}
[TestMethod]
public void TestTorqueConverter()
{
cGBX cGbx = new cGBX();
VECTO_Global.MyAppPath = @".\";
VECTO_Global.MyDeclPath = @"E:\QUAM\Workspace\VECTO_quam\Declaration\";
VECTO_Global.sKey = new csKey();
VECTO_Global.Declaration = new cDeclaration();
VECTO_Global.Cfg = new Configuration() {
DeclMode = false
};
VECTO_Global.DEV = new cDEV() {
TClimitOn = true,
TClimit = 1600,
TCaccmin = 0.025f,
TCiterPrec = 0.001f,
};
VECTO_Global.VEC = new cVECTO() {
EngOnly = false,
AuxiliaryAssembly = "CLASSIC"
};
VECTO_Global.VEC.set_DesMaxFile(true,
@"E:\QUAM\Workspace\VECTO_quam\Generic Vehicles\Engineering Mode\12t Delivery Truck\Truck.vacc");
VECTO_Global.VEC.Init();
VECTO_Global.DRI = new cDRI();
VECTO_Global.DRI.FilePath = @"..\..\..\..\Declaration\MissionCycles\Citybus_Suburban.vdri";
VECTO_Global.DRI.ReadFile();
VECTO_Global.DRI.GradToAlt();
VECTO_Global.MODdata = new cMOD();
VECTO_Global.MODdata.Init();
if (VECTO_Global.DRI.Scycle) {
VECTO_Global.MODdata.Vh.SetAlt();
var foo = VECTO_Global.DRI.ConvStoT();
}
VECTO_Global.MODdata.CycleInit();
VECTO_Global.GBX = cGbx;
VECTO_Global.ENG = new cENG();
VECTO_Global.ENG.FilePath =
@"..\..\..\..\Generic Vehicles\Engineering Mode\AT-TC Demo Vehicle\Engine.veng";
//"..\\..\\..\\Generic Vehicles\\Declaration Mode\\12t Delivery Truck\\12t Delivery Truck.veng";
VECTO_Global.ENG.ReadFile(true);
VECTO_Global.ENG.Init();
VECTO_Global.LogFile = new VECTO_Global.cLogFile();
cGbx.FilePath = @"..\..\..\..\Generic Vehicles\Engineering Mode\AT-TC Demo Vehicle\Gearbox.vgbx";
//"..\\..\\..\\Generic Vehicles\\Declaration Mode\\12t Delivery Truck\\12t Delivery Truck.vgbx";
var flag = cGbx.ReadFile(true);
flag = cGbx.GSinit();
if (cGbx.TCon) {
cGbx.TCinit();
}
flag = ((cENG)VECTO_Global.ENG).Init();
//cGbx.DeclInit();
for (var nOut = 10; nOut < 200; nOut += 10) {
for (var Pout = 10; Pout < 200; Pout += 20) {
flag = cGbx.TCiteration(1, nOut, Pout, 0);
Assert.IsTrue(flag);
Debug.WriteLine("n_out: {0}, P_out: {1}, n_in: {2}, Tq_in: {3}, reduce: {4}", nOut, Pout, cGbx.TCnUin, cGbx.TCMin,
cGbx.TCReduce);
}
}
//flag = cGbx.TCiteration(1, 100, 5, 0);
//Assert.IsTrue(flag);
//Assert.AreEqual(0, cGbx.TCnUin);
//Assert.AreEqual(0, cGbx.TCMin);
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{49F0275A-4517-49FA-859E-77279B9C8B18}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VectoLegacyTests</RootNamespace>
<AssemblyName>VectoLegacyTests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
</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>
</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>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="TorqueConverterTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\VECTO\VECTO.vbproj">
<Project>{AAC0F132-0A9F-45B3-B682-77AC9B24B352}</Project>
<Name>VECTO</Name>
</ProjectReference>
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\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>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment