sharee.bike-App/TestShareeLib/Repository/Request/TestQueryBuilderHelper.cs

46 lines
1.2 KiB
C#
Raw Normal View History

2022-08-30 15:42:25 +02:00
using NUnit.Framework;
using TINK.Repository.Request;
namespace TestShareeLib.Repository.Request
{
2022-09-06 16:08:19 +02:00
[TestFixture]
public class TestQueryBuilderHelper
{
[Test]
public void TestGetSessionIdQueryElement()
=> Assert.That(
QueryBuilderHelper.GetSessionIdQueryElement("?", "123", "456"),
Is.EqualTo("?sessionid=456123"));
2022-08-30 15:42:25 +02:00
2022-09-06 16:08:19 +02:00
[Test]
public void TestGetSessionIdQueryElementMerchantNull()
=> Assert.That(
QueryBuilderHelper.GetSessionIdQueryElement("?", null, "456"),
Is.EqualTo("?sessionid=456"));
2022-08-30 15:42:25 +02:00
2022-09-06 16:08:19 +02:00
[Test]
public void TestGetSessionIdQueryElementSessionCookieNull()
=> Assert.That(
QueryBuilderHelper.GetSessionIdQueryElement("?", "123", null),
Is.EqualTo("?sessionid=123"));
2022-08-30 15:42:25 +02:00
2022-09-06 16:08:19 +02:00
[Test]
public void TestGetSessionIdQueryElementNull()
=> Assert.That(
QueryBuilderHelper.GetSessionIdQueryElement("?", null),
Is.EqualTo(""));
2022-08-30 15:42:25 +02:00
2022-09-06 16:08:19 +02:00
[Test]
public void TestGetLanguageQueryElement()
=> Assert.That(
QueryBuilderHelper.GetLanguageQueryElement("&", "de"),
Is.EqualTo("&lang=de"));
2022-08-30 15:42:25 +02:00
2022-09-06 16:08:19 +02:00
[Test]
public void TestGetLanguageQueryElementNull()
=> Assert.That(
QueryBuilderHelper.GetLanguageQueryElement("&", ""),
Is.EqualTo(""));
}
2022-08-30 15:42:25 +02:00
}