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("Тройник 20-16-16", "Тройник -PLATINUM 20-16-16")]
|
||||||
[TestCase("Тройник 20x16x16", "Тройник -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)
|
public void TPieceTest(string query, string modified)
|
||||||
=> Execute(productType: "Тройник RAUTITAN", query, modified);
|
=> Execute(productType: "Тройник RAUTITAN", query, modified);
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ public class TPiece : DrinkingWaterHeatingFitting
|
|||||||
output = string.Empty;
|
output = string.Empty;
|
||||||
var diameters = _diameter.Matches(input)
|
var diameters = _diameter.Matches(input)
|
||||||
.Select(match => match.Groups["Diameter"].Value)
|
.Select(match => match.Groups["Diameter"].Value)
|
||||||
|
.Select(d => int.Parse(d))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
if (diameters.Length == 1)
|
if (diameters.Length == 1)
|
||||||
{
|
{
|
||||||
@ -17,7 +18,14 @@ public class TPiece : DrinkingWaterHeatingFitting
|
|||||||
}
|
}
|
||||||
else if (diameters.Length >= 3)
|
else if (diameters.Length >= 3)
|
||||||
{
|
{
|
||||||
output = $"{_title} {diameters[0]}-{diameters[1]}-{diameters[2]}";
|
if (diameters[2] > diameters[0])
|
||||||
|
{
|
||||||
|
output = $"{_title} {diameters[2]}-{diameters[1]}-{diameters[0]}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
output = $"{_title} {diameters[0]}-{diameters[1]}-{diameters[2]}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user