mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-06-24 07:36:35 +02:00
76 lines
1.6 KiB
C#
76 lines
1.6 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using NUnit.Framework;
|
|
using TINK.Model.Connector.Filter;
|
|
|
|
namespace TestShareeLib.Model.Connector.Filter
|
|
{
|
|
[TestFixture]
|
|
public class TestIntersectGroupFilterHelper
|
|
{
|
|
[Test]
|
|
public void TestGetBikeCategory()
|
|
{
|
|
CollectionAssert.AreEqual(
|
|
"300102",
|
|
"Fr_300102".GetBikeCategory());
|
|
}
|
|
|
|
[Test]
|
|
public void TestGetBikeCategoryEmpty()
|
|
{
|
|
CollectionAssert.AreEqual(
|
|
"",
|
|
"CAD_".GetBikeCategory());
|
|
}
|
|
|
|
[Test]
|
|
public void TestToBikeCategory()
|
|
{
|
|
CollectionAssert.AreEqual(
|
|
new List<string> { "300102", "777" },
|
|
IntersectGroupFilterHelper.ToBikeCategory(new List<string> { "KN_300102", "Bla_XXX", "FR_777" }));
|
|
}
|
|
|
|
[Test]
|
|
public void TestToBikeCategoryEmpty()
|
|
{
|
|
Assert.That(
|
|
IntersectGroupFilterHelper.ToBikeCategory(new List<string> { "KN_" }).Count(),
|
|
Is.EqualTo(0));
|
|
}
|
|
|
|
[Test]
|
|
public void TestIntersectByGoupId()
|
|
{
|
|
CollectionAssert.AreEqual(
|
|
new List<string> { "FR_300101" },
|
|
new List<string> { "FR_300101", "XY_777" }.IntersectByGoupId(new List<string> { "XY_776", "KN_300101" }));
|
|
}
|
|
|
|
[Test]
|
|
public void TestIntersectByGoupId_Empty()
|
|
{
|
|
CollectionAssert.AreEqual(
|
|
new List<string>(),
|
|
new List<string> { "FR_300102" }.IntersectByGoupId(new List<string> { "FR_300101" }));
|
|
}
|
|
|
|
[Test]
|
|
public void TestContainsGroupId_True()
|
|
{
|
|
Assert.That(
|
|
new List<string> { "FR_300101", "XY_777" }.ContainsGroupId("KN_300101"),
|
|
Is.True);
|
|
}
|
|
|
|
[Test]
|
|
public void TestContainsGroupId_False()
|
|
{
|
|
Assert.That(
|
|
new List<string> { "FR_300101", "XY_777" }.ContainsGroupId("XY_776"),
|
|
Is.False);
|
|
}
|
|
}
|
|
}
|