Skip to content

Commit

Permalink
Merge pull request #25 from intento/feature/CONTMS-101
Browse files Browse the repository at this point in the history
CONTMS-101 TMS: Trados: Create build scripts
  • Loading branch information
oerodger authored Apr 20, 2021
2 parents f8fe18b + 759a5e6 commit 8bc5ff3
Show file tree
Hide file tree
Showing 131 changed files with 1,469 additions and 644,629 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net45</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="IntentoSDK" Version="1.5.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Intento.MT.Plugin.PropertiesForm\Intento.MT.Plugin.PropertiesForm.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>

</Project>
35 changes: 14 additions & 21 deletions Tests.cs → ...to.MT.Plugin.PropertiesForm.Test/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Resources;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Intento.MT.Plugin.PropertiesForm.WinForms;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft;
using Newtonsoft.Json.Linq;
using static Intento.MT.Plugin.PropertiesForm.ApiKeyState;
using static Intento.MT.Plugin.PropertiesForm.IntentoTranslationProviderOptionsForm;
using NUnit.Framework;

namespace Intento.MT.Plugin.PropertiesForm
{
[TestClass]
namespace Intento.MT.Plugin.PropertiesForm.Test
{
public sealed class Tests
{
private IntentoSDK.IntentoAiTextTranslate Fabric(string apiKey, string userAgent, IntentoSDK.ProxySettings proxySettings)
Expand Down Expand Up @@ -409,7 +401,7 @@ Form InitializeForm(Form form)
#endregion all parametries filled, auth - delegated, models & glossary - delegated

#region auth - not delegated (the provider has no predefined), models & glossary - empty
[TestMethod]
[Test]
public void InitionalFillOptionsForm2()
{
IntentoTranslationProviderOptionsForm form;
Expand Down Expand Up @@ -491,9 +483,9 @@ public void InitionalFillOptionsForm2()
Assert.AreEqual(true, form.groupBoxMTConnect2.Visible);
Assert.AreEqual(options.ApiKey, form.apiKey_tb.Text);
Assert.AreEqual(options.ProviderName, form.textBoxProviderName.Text);
Assert.AreEqual(Resource.Empty, form.textBoxAccount.Text);
Assert.AreEqual(Resource.Empty, form.textBoxModel.Text);
Assert.AreEqual(Resource.Empty, form.textBoxGlossary.Text);
Assert.AreEqual(string.Empty, form.textBoxAccount.Text);
Assert.AreEqual(string.Empty, form.textBoxModel.Text);
Assert.AreEqual(string.Empty, form.textBoxGlossary.Text);
Assert.AreEqual(true, form.buttonContinue.Enabled);
form.formMT.Close();
qqq.Refresh();
Expand All @@ -502,7 +494,7 @@ public void InitionalFillOptionsForm2()
#endregion auth - not delegated (the provider has no predefined), models & glossary - empty

#region all parametries filled, auth - delegated, models & glossary - not delegated
[TestMethod]
[Test]
public void InitionalFillOptionsForm3()
{
options = new IntentoMTFormOptions()
Expand Down Expand Up @@ -712,7 +704,7 @@ public void InitionalFillOptionsForm3()
//}
#endregion only API key filled, smartRouting - true

[TestMethod]
[Test]
public void CleanOptionsOnChangeProvider()
{
#region all parametries filled, auth - not delegated, models & glossary - delegated
Expand Down Expand Up @@ -772,7 +764,7 @@ public void CleanOptionsOnChangeProvider()
qqq.Close();
}

[TestMethod]
[Test]
public void CleanOptionsOnChangeCreditionals()
{
// all parametries filled, auth, models & glossary - delegated
Expand Down Expand Up @@ -856,7 +848,8 @@ public void CleanOptionsOnChangeCreditionals()
}

#region ChangeOfLanguageOnChangeModel: all parametries filled, auth - delegated, models & glossary - delegated
[TestMethod]

[Test]
public void ChangeOfLanguageOnChangeModel()
{
options = new IntentoMTFormOptions()
Expand All @@ -878,7 +871,7 @@ public void ChangeOfLanguageOnChangeModel()
};
using (form = new IntentoTranslationProviderOptionsForm(options, langPair, Fabric, true))
{
testProviderData.delegated_credentials = true;
testProviderData.delegated_credentials = true;
form.testListProvidersData = testProvidersData;
form.testOneProviderData = testProviderData;
form.testAuthData = testAuthDataGoogle;
Expand Down Expand Up @@ -950,7 +943,7 @@ public void ChangeOfLanguageOnChangeModel()
Assert.AreEqual(options.ApiKey, form.apiKey_tb.Text);
Assert.AreEqual(options.ProviderName, form.textBoxProviderName.Text);
Assert.AreEqual("test1", form.textBoxAccount.Text);
Assert.AreEqual(Resource.Empty, form.textBoxModel.Text);
Assert.AreEqual(string.Empty, form.textBoxModel.Text);
Assert.AreEqual("gloss_ru_en", form.textBoxGlossary.Text);
Assert.AreEqual(true, form.buttonContinue.Enabled);
form.formMT.Close();
Expand Down
18 changes: 10 additions & 8 deletions Intento.MT.Plugin.PropertiesForm.sln
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2050
# Visual Studio Version 16
VisualStudioVersion = 16.0.31105.61
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Intento.MT.Plugin.PropertiesForm", "Intento.MT.Plugin.PropertiesForm.csproj", "{A4374128-DD01-4CE3-B62C-4CC3460620C0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestForm", "TestForm\TestForm.csproj", "{A963C442-DFD3-4FE8-A2E1-9917AC274695}"
ProjectSection(ProjectDependencies) = postProject
{A4374128-DD01-4CE3-B62C-4CC3460620C0} = {A4374128-DD01-4CE3-B62C-4CC3460620C0}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Intento.MT.Plugin.PropertiesForm.Test", "Intento.MT.Plugin.PropertiesForm.Test\Intento.MT.Plugin.PropertiesForm.Test.csproj", "{5954BDAE-A274-4615-9E94-2D0A6FA8B786}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Intento.MT.Plugin.PropertiesForm", "Intento.MT.Plugin.PropertiesForm\Intento.MT.Plugin.PropertiesForm.csproj", "{A4374128-DD01-4CE3-B62C-4CC3460620C0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A963C442-DFD3-4FE8-A2E1-9917AC274695}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A963C442-DFD3-4FE8-A2E1-9917AC274695}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5954BDAE-A274-4615-9E94-2D0A6FA8B786}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5954BDAE-A274-4615-9E94-2D0A6FA8B786}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4374128-DD01-4CE3-B62C-4CC3460620C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4374128-DD01-4CE3-B62C-4CC3460620C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4374128-DD01-4CE3-B62C-4CC3460620C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4374128-DD01-4CE3-B62C-4CC3460620C0}.Release|Any CPU.Build.0 = Release|Any CPU
{A963C442-DFD3-4FE8-A2E1-9917AC274695}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A963C442-DFD3-4FE8-A2E1-9917AC274695}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A963C442-DFD3-4FE8-A2E1-9917AC274695}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A963C442-DFD3-4FE8-A2E1-9917AC274695}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<DoSign Condition="'$(DoSign)' == ''">0</DoSign>
<IntentoSDKPath Condition="'$(IntentoSDKPath)' == ''">..\intento-csharp\bin\</IntentoSDKPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<OutputPath Condition="'$(OutputPath)' == ''">bin\</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\</OutputPath>
<OutputPath Condition="'$(OutputPath)' == ''">bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -34,19 +36,14 @@
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>intento.pfx</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>intento_sn.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="IntentoSDK">
<HintPath>..\intento-csharp\bin\IntentoSDK.dll</HintPath>
<Reference Include="IntentoSDK, Version=1.5.2.0, Culture=neutral, PublicKeyToken=7fbf26cf2c5f5508, processorArchitecture=MSIL">
<HintPath>..\..\packages\IntentoSDK.1.5.2\lib\net45\IntentoSDK.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\intento-csharp\bin\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -61,7 +58,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Logs.cs" />
<Compile Include="Tests.cs" />
<Compile Include="WinForms\IntentoFormIgnoreError.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -150,11 +146,11 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include=".gitignore" />
<None Include="app.config" />
<None Include="githashForm.bat" />
<None Include="intento.pfx" />
<None Include="intento_sn.snk" />
<None Include="packages.config" />
<None Include="README.md" />
<None Include="Properties\Intento.MT.Plugin.PropertiesForm.nuspec" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\intento.ico" />
Expand All @@ -163,4 +159,7 @@
<PropertyGroup>
<PreBuildEvent>$(ProjectDir)githashForm.bat &gt;$(ProjectDir)GitHash.cs</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent Condition="'$(DoSign)' == '1'">powershell -ExecutionPolicy RemoteSigned $(ProjectDir)postbuild.ps1 '$(TargetDir)$(TargetName).dll'</PostBuildEvent>
</PropertyGroup>
</Project>
File renamed without changes.
Loading

0 comments on commit 8bc5ff3

Please sign in to comment.