This commit is contained in:
parent
a0a1c23c4d
commit
194d85fbfe
@ -15,6 +15,7 @@ public class RautitanFittingsTests : ProductQueryModifierTests
|
||||
|
||||
[TestCase("Тройник 20-16-16", "Тройник -PLATINUM 20-16-16")]
|
||||
[TestCase("Тройник 20x16x16", "Тройник -PLATINUM 20-16-16")]
|
||||
[TestCase("Тройник 20-16-25", "Тройник -PLATINUM 25-16-20")]
|
||||
public void TPieceTest(string query, string modified)
|
||||
=> Execute(productType: "Тройник RAUTITAN", query, modified);
|
||||
|
||||
|
@ -10,15 +10,23 @@ public class TPiece : DrinkingWaterHeatingFitting
|
||||
output = string.Empty;
|
||||
var diameters = _diameter.Matches(input)
|
||||
.Select(match => match.Groups["Diameter"].Value)
|
||||
.Select(d => int.Parse(d))
|
||||
.ToArray();
|
||||
if (diameters.Length == 1)
|
||||
{
|
||||
output = $"{_title} {diameters[0]}-{diameters[0]}-{diameters[0]}";
|
||||
}
|
||||
else if (diameters.Length >= 3)
|
||||
{
|
||||
if (diameters[2] > diameters[0])
|
||||
{
|
||||
output = $"{_title} {diameters[2]}-{diameters[1]}-{diameters[0]}";
|
||||
}
|
||||
else
|
||||
{
|
||||
output = $"{_title} {diameters[0]}-{diameters[1]}-{diameters[2]}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user