0
0

Compare commits

..

No commits in common. "931b08e00d8822e98db036c169dcbe83c2361635" and "ef35ac999025339e779f95ab07a1f6ae4ea3fe95" have entirely different histories.

6 changed files with 6 additions and 102 deletions

35
.vscode/launch.json vendored
View File

@ -1,35 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md.
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/RhSolutions.Api/bin/Debug/net6.0/RhSolutions.Api.dll",
"args": [],
"cwd": "${workspaceFolder}/RhSolutions.Api",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}

41
.vscode/tasks.json vendored
View File

@ -1,41 +0,0 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/RhSolutions.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/RhSolutions.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/RhSolutions.sln"
],
"problemMatcher": "$msCompile"
}
]
}

View File

@ -4,7 +4,6 @@ public class RautitanFittingsTests : ProductQueryModifierTests
{
[TestCase("Гильза 16", "Монтажная гильза 16")]
[TestCase("Пресс-втулка 20", "Монтажная гильза 20")]
[TestCase("UPONOR Q&E EVOLUTION КОЛЬЦО БЕЛОЕ 16 '900Ф", "Монтажная гильза 16")]
public void SleeveTest(string query, string modified)
=> Execute(productType: "Монтажная гильза", query, modified);
@ -20,7 +19,6 @@ public class RautitanFittingsTests : ProductQueryModifierTests
[TestCase("муфта 20", "Муфта соединительная равнопроходная 20")]
[TestCase("переходник 20-16", "Муфта соединительная переходная 20-16")]
[TestCase("переходник 16-20", "Муфта соединительная переходная 20-16")]
[TestCase("Соединение труба-труба 20/20, бронза", "Муфта соединительная равнопроходная 20")]
[TestCase("Муфта соединительная переходная 20x16 для труб из сшитого полиэтилена аксиальный", "Муфта соединительная переходная 20-16")]
public void CouplingTest(string query, string modified)
@ -121,8 +119,4 @@ public class RautitanFittingsTests : ProductQueryModifierTests
[TestCase("Фитинг подключения L и T-образной медной трубки - D15 - G 3/4", "Резьбозажимное соединение для металлической трубки G 3/4 -15")]
public void EuroconeConnectionBendTest(string query, string modified)
=> Execute(productType: "Резьбозажимное для трубки", query, modified);
[TestCase("Ниппель", "К-т двух резьбозажим. нипелей с нар.резьбой 1/2х3/4")]
public void NippelTest(string query, string modified)
=> Execute(productType: "Ниппель", query, modified);
}

View File

@ -5,22 +5,19 @@ public class Coupling : DrinkingWaterHeatingFitting
protected override string _title => "Муфта соединительная";
protected override string? BuildRhSolutionsName(string query)
{
var diametersMatches = _diameter.Matches(query);
if (diametersMatches.Count == 0)
var diameters = _diameter.Matches(query);
if (diameters.Count == 0)
{
return null;
}
var diameters = diametersMatches.Select(x => x.Groups["Diameter"].Value)
.Take(2)
.OrderByDescending(x => int.Parse(x))
.ToArray();
if (diameters.Length == 1 || diameters[0] == diameters[1])
if (diameters.Count < 2 ||
diameters.Count > 1 && diameters[0].Groups["Diameter"].Value == diameters[1].Groups["Diameter"].Value)
{
return $"{_title} равнопроходная {diameters[0]}";
return $"{_title} равнопроходная {diameters[0].Groups["Diameter"]}";
}
else
{
return $"{_title} переходная {diameters[0]}-{diameters[1]}";
return $"{_title} переходная {diameters[0].Groups["Diameter"]}-{diameters[1].Groups["Diameter"]}";
}
}
}

View File

@ -1,9 +0,0 @@
namespace RhSolutions.QueryModifiers.DrinkingWaterHeatingFittings;
public class Nippel : DrinkingWaterHeatingFitting
{
protected override string? BuildRhSolutionsName(string query)
{
return "К-т двух резьбозажим. нипелей с нар.резьбой 1/2х3/4";
}
}

View File

@ -57,8 +57,6 @@ public class ProductQueryModifierFactory
return new EuroconeAdapter();
case "Резьбозажимное для трубки":
return new EuroconeConnectionBend();
case "Ниппель":
return new Nippel();
case "Заглушка труб RAUTITAN":
return new DummyPlug();
case "Flex":