Version 3.0.338

This commit is contained in:
Anja Müller-Meißner 2022-09-06 16:08:19 +02:00 committed by Anja
parent 573fe77e12
commit 0468955d49
751 changed files with 62747 additions and 60672 deletions

View file

@ -6,36 +6,36 @@ using TINK.Repository.Response;
namespace TestShareeLib.Model.Connector.Updater
{
[TestFixture]
public class TestBookingFinishedModelFactory
{
/// <summary>
/// COPRI response shortened, part not belonging to user_miniquery discarded.
/// </summary>
[Test]
public void TestCreateMiniSurvey_Co2Saving()
{
var response = JsonConvert.DeserializeObject<ResponseContainer<DoReturnResponse>>(@"
[TestFixture]
public class TestBookingFinishedModelFactory
{
/// <summary>
/// COPRI response shortened, part not belonging to user_miniquery discarded.
/// </summary>
[Test]
public void TestCreateMiniSurvey_Co2Saving()
{
var response = JsonConvert.DeserializeObject<ResponseContainer<DoReturnResponse>>(@"
{
""shareejson"" : {
""co2saving"" : ""Einsparung: 1,95 kg CO2 und 3,00 EUR bei einer Strecke von 10 KM""
}
}");
var bookingFinshed = response.shareejson.Create();
var bookingFinshed = response.shareejson.Create();
Assert.That(
bookingFinshed.Co2Saving,
Is.EqualTo("Einsparung: 1,95 kg CO2 und 3,00 EUR bei einer Strecke von 10 KM"));
Assert.That(
bookingFinshed.Co2Saving,
Is.EqualTo("Einsparung: 1,95 kg CO2 und 3,00 EUR bei einer Strecke von 10 KM"));
}
/// <summary>
/// COPRI response shortened, part not belonging to user_miniquery discarded.
/// </summary>
[Test]
public void TestCreateMiniSurvey()
{
var response = JsonConvert.DeserializeObject<ResponseContainer<DoReturnResponse>>(@"
}
/// <summary>
/// COPRI response shortened, part not belonging to user_miniquery discarded.
/// </summary>
[Test]
public void TestCreateMiniSurvey()
{
var response = JsonConvert.DeserializeObject<ResponseContainer<DoReturnResponse>>(@"
{
""shareejson"" : {
""user_miniquery"" : {
@ -82,36 +82,36 @@ namespace TestShareeLib.Model.Connector.Updater
");
var bookingFinished = response.shareejson.Create();
var bookingFinished = response.shareejson.Create();
Assert.That(
bookingFinished,
Is.Not.Null);
Assert.That(
bookingFinished,
Is.Not.Null);
Assert.That(
bookingFinished.MiniSurvey.Title,
Is.EqualTo("Bitte unterstützen Sie unsere Begleitforschung"));
Assert.That(
bookingFinished.MiniSurvey.Title,
Is.EqualTo("Bitte unterstützen Sie unsere Begleitforschung"));
Assert.That(
bookingFinished.MiniSurvey.Subtitle,
Is.EqualTo("Ihre drei Antworten werden anonym gespeichert."));
Assert.That(
bookingFinished.MiniSurvey.Subtitle,
Is.EqualTo("Ihre drei Antworten werden anonym gespeichert."));
Assert.That(
bookingFinished.MiniSurvey.Footer,
Is.EqualTo("Herzlichen Dank und viel Spaß bei der nächsten Fahrt!"));
Assert.That(
bookingFinished.MiniSurvey.Footer,
Is.EqualTo("Herzlichen Dank und viel Spaß bei der nächsten Fahrt!"));
Assert.That(
bookingFinished.MiniSurvey.Questions.Count,
Is.EqualTo(3));
}
Assert.That(
bookingFinished.MiniSurvey.Questions.Count,
Is.EqualTo(3));
}
/// <summary>
/// COPRI response shortened, part not belonging to user_miniquery discarded.
/// </summary>
[Test]
public void TestCreateMiniSurvey_Null()
{
var response = JsonConvert.DeserializeObject<ResponseContainer<DoReturnResponse>>(@"
/// <summary>
/// COPRI response shortened, part not belonging to user_miniquery discarded.
/// </summary>
[Test]
public void TestCreateMiniSurvey_Null()
{
var response = JsonConvert.DeserializeObject<ResponseContainer<DoReturnResponse>>(@"
{
""shareejson"" : {
}
@ -119,36 +119,36 @@ namespace TestShareeLib.Model.Connector.Updater
");
var bookingFinshed = response.shareejson.Create();
var bookingFinshed = response.shareejson.Create();
Assert.That(
bookingFinshed,
Is.Not.Null);
Assert.That(
bookingFinshed,
Is.Not.Null);
Assert.That(
bookingFinshed.MiniSurvey.Questions.Count,
Is.EqualTo(0));
Assert.That(
bookingFinshed.MiniSurvey.Questions.Count,
Is.EqualTo(0));
Assert.That(
bookingFinshed.MiniSurvey.Title,
Is.Null);
Assert.That(
bookingFinshed.MiniSurvey.Title,
Is.Null);
Assert.That(
bookingFinshed.MiniSurvey.Subtitle,
Is.Null);
Assert.That(
bookingFinshed.MiniSurvey.Subtitle,
Is.Null);
Assert.That(
bookingFinshed.MiniSurvey.Footer,
Is.Null);
}
Assert.That(
bookingFinshed.MiniSurvey.Footer,
Is.Null);
}
/// <summary>
/// COPRI response shortened, part not belonging to user_miniquery discarded.
/// </summary>
[Test]
public void TestCreateMiniSurvey_EmptyQuery()
{
var response = JsonConvert.DeserializeObject<ResponseContainer<DoReturnResponse>>(@"
/// <summary>
/// COPRI response shortened, part not belonging to user_miniquery discarded.
/// </summary>
[Test]
public void TestCreateMiniSurvey_EmptyQuery()
{
var response = JsonConvert.DeserializeObject<ResponseContainer<DoReturnResponse>>(@"
{
""shareejson"" : {
""user_miniquery"" : {
@ -158,32 +158,32 @@ namespace TestShareeLib.Model.Connector.Updater
");
var bookingFinished = response.shareejson.Create();
var bookingFinished = response.shareejson.Create();
Assert.That(
bookingFinished,
Is.Not.Null);
Assert.That(
bookingFinished,
Is.Not.Null);
Assert.That(
bookingFinished.MiniSurvey.Title,
Is.Null);
Assert.That(
bookingFinished.MiniSurvey.Title,
Is.Null);
Assert.That(
bookingFinished.MiniSurvey.Subtitle,
Is.Null);
Assert.That(
bookingFinished.MiniSurvey.Subtitle,
Is.Null);
Assert.That(
bookingFinished.MiniSurvey.Footer,
Is.Null);
}
Assert.That(
bookingFinished.MiniSurvey.Footer,
Is.Null);
}
/// <summary>
/// COPRI response shortened, part not belonging to user_miniquery discarded.
/// </summary>
[Test]
public void TestCreateMiniSurvey_InvalidQuestion_KeyNull()
{
var response = JsonConvert.DeserializeObject<ResponseContainer<DoReturnResponse>>(@"
/// <summary>
/// COPRI response shortened, part not belonging to user_miniquery discarded.
/// </summary>
[Test]
public void TestCreateMiniSurvey_InvalidQuestion_KeyNull()
{
var response = JsonConvert.DeserializeObject<ResponseContainer<DoReturnResponse>>(@"
{
""shareejson"" : {
""user_miniquery"" : {
@ -210,24 +210,24 @@ namespace TestShareeLib.Model.Connector.Updater
");
var bookingFinised = response.shareejson.Create();
var bookingFinised = response.shareejson.Create();
Assert.That(
bookingFinised,
Is.Not.Null);
Assert.That(
bookingFinised,
Is.Not.Null);
Assert.That(
bookingFinised.MiniSurvey.Questions.Count,
Is.EqualTo(0));
}
Assert.That(
bookingFinised.MiniSurvey.Questions.Count,
Is.EqualTo(0));
}
/// <summary>
/// COPRI response shortened, part not belonging to user_miniquery discarded.
/// </summary>
[Test]
public void TestCreateMiniSurvey_InvalidQuestion_ValueNull()
{
var response = JsonConvert.DeserializeObject<ResponseContainer<DoReturnResponse>>(@"
/// <summary>
/// COPRI response shortened, part not belonging to user_miniquery discarded.
/// </summary>
[Test]
public void TestCreateMiniSurvey_InvalidQuestion_ValueNull()
{
var response = JsonConvert.DeserializeObject<ResponseContainer<DoReturnResponse>>(@"
{
""shareejson"" : {
""user_miniquery"" : {
@ -244,16 +244,16 @@ namespace TestShareeLib.Model.Connector.Updater
");
var bookingFinished = response.shareejson.Create();
var bookingFinished = response.shareejson.Create();
Assert.That(
bookingFinished,
Is.Not.Null);
Assert.That(
bookingFinished,
Is.Not.Null);
Assert.That(
bookingFinished.MiniSurvey.Questions.Count,
Is.EqualTo(0));
}
Assert.That(
bookingFinished.MiniSurvey.Questions.Count,
Is.EqualTo(0));
}
}
}
}

View file

@ -6,47 +6,47 @@ using TINK.Repository.Response;
namespace TestShareeLib.Model.Connector.Updater
{
[TestFixture]
public class TestDriveFactory
{
[Test]
public void TestEmpty()
{
var response = JsonConvert.DeserializeObject<BikeType>(@"");
[TestFixture]
public class TestDriveFactory
{
[Test]
public void TestEmpty()
{
var response = JsonConvert.DeserializeObject<BikeType>(@"");
Assert.That(
response.Create().Type,
Is.EqualTo(DriveType.SoleHumanPowered));
Assert.That(
response.Create().Type,
Is.EqualTo(DriveType.SoleHumanPowered));
Assert.That(
response.Create().Engine.Manufacturer,
Is.Null);
Assert.That(
response.Create().Engine.Manufacturer,
Is.Null);
Assert.That(
response.Create().Battery.CurrentChargePercent,
Is.NaN);
Assert.That(
response.Create().Battery.CurrentChargePercent,
Is.NaN);
Assert.That(
response.Create().Battery.CurrentChargeBars,
Is.Null);
Assert.That(
response.Create().Battery.CurrentChargeBars,
Is.Null);
Assert.That(
response.Create().Battery.MaxChargeBars,
Is.Null);
Assert.That(
response.Create().Battery.MaxChargeBars,
Is.Null);
Assert.That(
response.Create().Battery.IsBackendAccessible,
Is.Null);
Assert.That(
response.Create().Battery.IsBackendAccessible,
Is.Null);
Assert.That(
response.Create().Battery.IsHidden,
Is.Null);
}
Assert.That(
response.Create().Battery.IsHidden,
Is.Null);
}
[Test]
public void TestEmptyEngine()
{
var response = JsonConvert.DeserializeObject<BikeType>(@"
[Test]
public void TestEmptyEngine()
{
var response = JsonConvert.DeserializeObject<BikeType>(@"
{
""category"" : ""cargo"",
""wheels"" : ""2"",
@ -54,31 +54,31 @@ namespace TestShareeLib.Model.Connector.Updater
}
}");
Assert.That(
response.Create().Type,
Is.EqualTo(DriveType.SoleHumanPowered));
Assert.That(
response.Create().Type,
Is.EqualTo(DriveType.SoleHumanPowered));
Assert.That(
response.Create().Engine.Manufacturer,
Is.Null);
Assert.That(
response.Create().Engine.Manufacturer,
Is.Null);
Assert.That(
response.Create().Battery.CurrentChargePercent,
Is.NaN);
Assert.That(
response.Create().Battery.CurrentChargePercent,
Is.NaN);
Assert.That(
response.Create().Battery.CurrentChargeBars,
Is.Null);
Assert.That(
response.Create().Battery.CurrentChargeBars,
Is.Null);
Assert.That(
response.Create().Battery.MaxChargeBars,
Is.Null);
}
Assert.That(
response.Create().Battery.MaxChargeBars,
Is.Null);
}
[Test]
public void TestEngine()
{
var response = JsonConvert.DeserializeObject<BikeType>(@"
[Test]
public void TestEngine()
{
var response = JsonConvert.DeserializeObject<BikeType>(@"
{
""category"" : ""cargo"",
""wheels"" : ""2"",
@ -88,31 +88,31 @@ namespace TestShareeLib.Model.Connector.Updater
}");
Assert.That(
response.Create().Type,
Is.EqualTo(DriveType.Pedelec));
Assert.That(
response.Create().Type,
Is.EqualTo(DriveType.Pedelec));
Assert.That(
response.Create().Engine.Manufacturer,
Is.EqualTo("dummy"));
Assert.That(
response.Create().Engine.Manufacturer,
Is.EqualTo("dummy"));
Assert.That(
response.Create().Battery.CurrentChargePercent,
Is.NaN);
Assert.That(
response.Create().Battery.CurrentChargePercent,
Is.NaN);
Assert.That(
response.Create().Battery.CurrentChargeBars,
Is.Null);
Assert.That(
response.Create().Battery.CurrentChargeBars,
Is.Null);
Assert.That(
response.Create().Battery.MaxChargeBars,
Is.Null);
}
Assert.That(
response.Create().Battery.MaxChargeBars,
Is.Null);
}
[Test]
public void TestBatteryValues1()
{
var response = JsonConvert.DeserializeObject<BikeType>(@"
[Test]
public void TestBatteryValues1()
{
var response = JsonConvert.DeserializeObject<BikeType>(@"
{
""category"" : ""cargo"",
""wheels"" : ""2"",
@ -128,39 +128,39 @@ namespace TestShareeLib.Model.Connector.Updater
}
}");
Assert.That(
response.Create().Type,
Is.EqualTo(DriveType.Pedelec));
Assert.That(
response.Create().Type,
Is.EqualTo(DriveType.Pedelec));
Assert.That(
response.Create().Engine.Manufacturer,
Is.EqualTo("dummy"));
Assert.That(
response.Create().Engine.Manufacturer,
Is.EqualTo("dummy"));
Assert.That(
response.Create().Battery.CurrentChargePercent,
Is.EqualTo(70.0));
Assert.That(
response.Create().Battery.CurrentChargePercent,
Is.EqualTo(70.0));
Assert.That(
response.Create().Battery.CurrentChargeBars,
Is.EqualTo(4));
Assert.That(
response.Create().Battery.CurrentChargeBars,
Is.EqualTo(4));
Assert.That(
response.Create().Battery.MaxChargeBars,
Is.EqualTo(5));
Assert.That(
response.Create().Battery.MaxChargeBars,
Is.EqualTo(5));
Assert.That(
response.Create().Battery.IsBackendAccessible,
Is.False);
Assert.That(
response.Create().Battery.IsBackendAccessible,
Is.False);
Assert.That(
response.Create().Battery.IsHidden,
Is.False);
}
Assert.That(
response.Create().Battery.IsHidden,
Is.False);
}
[Test]
public void TestBatteryValues2()
{
var response = JsonConvert.DeserializeObject<BikeType>(@"
[Test]
public void TestBatteryValues2()
{
var response = JsonConvert.DeserializeObject<BikeType>(@"
{
""category"" : ""cargo"",
""wheels"" : ""2"",
@ -176,33 +176,33 @@ namespace TestShareeLib.Model.Connector.Updater
}
}");
Assert.That(
response.Create().Type,
Is.EqualTo(DriveType.Pedelec));
Assert.That(
response.Create().Type,
Is.EqualTo(DriveType.Pedelec));
Assert.That(
response.Create().Engine.Manufacturer,
Is.EqualTo("dummy2"));
Assert.That(
response.Create().Engine.Manufacturer,
Is.EqualTo("dummy2"));
Assert.That(
response.Create().Battery.CurrentChargePercent,
Is.EqualTo(70.3));
Assert.That(
response.Create().Battery.CurrentChargePercent,
Is.EqualTo(70.3));
Assert.That(
response.Create().Battery.CurrentChargeBars,
Is.EqualTo(1));
Assert.That(
response.Create().Battery.CurrentChargeBars,
Is.EqualTo(1));
Assert.That(
response.Create().Battery.MaxChargeBars,
Is.EqualTo(6));
Assert.That(
response.Create().Battery.MaxChargeBars,
Is.EqualTo(6));
Assert.That(
response.Create().Battery.IsBackendAccessible,
Is.True);
Assert.That(
response.Create().Battery.IsBackendAccessible,
Is.True);
Assert.That(
response.Create().Battery.IsHidden,
Is.True);
}
}
Assert.That(
response.Create().Battery.IsHidden,
Is.True);
}
}
}

View file

@ -6,33 +6,33 @@ using TINK.Repository.Response;
namespace TestShareeLib.Model.Connector.Updater
{
[TestFixture]
public class TestRentalDescription
{
[TestFixture]
public class TestRentalDescription
{
[Test]
public void TestCreateRentalDescriptionEmpyJson()
{
var response = JsonConvert.DeserializeObject<RentalDescription>(@"");
[Test]
public void TestCreateRentalDescriptionEmpyJson()
{
var response = JsonConvert.DeserializeObject<RentalDescription>(@"");
Assert.That(
response.Create().Name,
Is.Empty);
Assert.That(
response.Create().Name,
Is.Empty);
Assert.That(
response.Create().TariffEntries.Count,
Is.EqualTo(0));
Assert.That(
response.Create().TariffEntries.Count,
Is.EqualTo(0));
Assert.That(
response.Create().InfoEntries.Count,
Is.EqualTo(0));
}
Assert.That(
response.Create().InfoEntries.Count,
Is.EqualTo(0));
}
[Test]
public void TestCreateRentalDescription()
{
var response = JsonConvertRethrow.DeserializeObject<RentalDescription>(
@"{
[Test]
public void TestCreateRentalDescription()
{
var response = JsonConvertRethrow.DeserializeObject<RentalDescription>(
@"{
""id"": ""1"",
""tarif_elements"" : {
""6"": [
@ -61,69 +61,69 @@ namespace TestShareeLib.Model.Connector.Updater
}
}");
Assert.That(
response.Create().Name,
Is.EqualTo("REN E-Bike"));
Assert.That(
response.Create().Name,
Is.EqualTo("REN E-Bike"));
Assert.That(
response.Create().Id,
Is.EqualTo(1));
Assert.That(
response.Create().Id,
Is.EqualTo(1));
Assert.That(
response.Create().TariffEntries.Count,
Is.EqualTo(3));
Assert.That(
response.Create().TariffEntries.Count,
Is.EqualTo(3));
Assert.That(
response.Create().InfoEntries.Count,
Is.EqualTo(2));
Assert.That(
response.Create().InfoEntries.Count,
Is.EqualTo(2));
Assert.That(
response.Create().TariffEntries["1"].Description,
Is.EqualTo("Mietgebühr"));
Assert.That(
response.Create().TariffEntries["1"].Description,
Is.EqualTo("Mietgebühr"));
Assert.That(
response.Create().TariffEntries["1"].Value,
Is.EqualTo("2,00 € / 1 Std"));
Assert.That(
response.Create().TariffEntries["1"].Value,
Is.EqualTo("2,00 € / 1 Std"));
Assert.That(
response.Create().TariffEntries["4"].Description,
Is.EqualTo("Max. Gebühr"));
Assert.That(
response.Create().TariffEntries["4"].Description,
Is.EqualTo("Max. Gebühr"));
Assert.That(
response.Create().TariffEntries["4"].Value,
Is.EqualTo("40.00 € / Tag"));
Assert.That(
response.Create().TariffEntries["4"].Value,
Is.EqualTo("40.00 € / Tag"));
Assert.That(
response.Create().TariffEntries["6"].Description,
Is.EqualTo("Gratis Mietzeit"));
Assert.That(
response.Create().TariffEntries["6"].Description,
Is.EqualTo("Gratis Mietzeit"));
Assert.That(
response.Create().TariffEntries["6"].Value,
Is.EqualTo("30 Min / Tag"));
Assert.That(
response.Create().TariffEntries["6"].Value,
Is.EqualTo("30 Min / Tag"));
Assert.That(
response.Create().InfoEntries["8"].Key,
Is.EqualTo("Tracking"));
Assert.That(
response.Create().InfoEntries["8"].Key,
Is.EqualTo("Tracking"));
Assert.That(
response.Create().InfoEntries["8"].Value,
Is.EqualTo("Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!"));
Assert.That(
response.Create().InfoEntries["8"].Value,
Is.EqualTo("Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!"));
Assert.That(
response.Create().InfoEntries["9"].Key,
Is.EqualTo("AGB"));
Assert.That(
response.Create().InfoEntries["9"].Key,
Is.EqualTo("AGB"));
Assert.That(
response.Create().InfoEntries["9"].Value,
Is.EqualTo("Mit der Mietrad Anmietung wird folgender Betreiber <a href='$varenv->{wwwhost}/site/agb.html' target='_blank'>AGB</a> zugestimmt"));
}
Assert.That(
response.Create().InfoEntries["9"].Value,
Is.EqualTo("Mit der Mietrad Anmietung wird folgender Betreiber <a href='$varenv->{wwwhost}/site/agb.html' target='_blank'>AGB</a> zugestimmt"));
}
[Test]
public void TestCreateRentalDescriptionDupeTarifElements()
{
var response = JsonConvertRethrow.DeserializeObject<RentalDescription>(
@"{
[Test]
public void TestCreateRentalDescriptionDupeTarifElements()
{
var response = JsonConvertRethrow.DeserializeObject<RentalDescription>(
@"{
""id"": ""1"",
""tarif_elements"" : {
""6"": [
@ -141,17 +141,17 @@ namespace TestShareeLib.Model.Connector.Updater
}
}");
Assert.That(
response.Create().TariffEntries.Count,
Is.EqualTo(2));
Assert.That(
response.Create().TariffEntries.Count,
Is.EqualTo(2));
}
}
[Test]
public void TestCreateRentalDescriptionDupeInfoElements()
{
var response = JsonConvertRethrow.DeserializeObject<RentalDescription>(
@"{
[Test]
public void TestCreateRentalDescriptionDupeInfoElements()
{
var response = JsonConvertRethrow.DeserializeObject<RentalDescription>(
@"{
""rental_info"" : {
""9"" : [
""AGB"",
@ -164,37 +164,37 @@ namespace TestShareeLib.Model.Connector.Updater
}
}");
Assert.That(
response.Create().InfoEntries.Count,
Is.EqualTo(1));
}
Assert.That(
response.Create().InfoEntries.Count,
Is.EqualTo(1));
}
[Test]
public void TestCreateRentalDescriptionsNoTariffElements()
{
var response = JsonConvertRethrow.DeserializeObject<RentalDescription>(
@"{
[Test]
public void TestCreateRentalDescriptionsNoTariffElements()
{
var response = JsonConvertRethrow.DeserializeObject<RentalDescription>(
@"{
""rental_info"" : {
}
}");
Assert.That(
response.Create().TariffEntries,
Is.Not.Null);
}
Assert.That(
response.Create().TariffEntries,
Is.Not.Null);
}
[Test]
public void TestCreateRentalDescriptionsNoInfoElements()
{
var response = JsonConvertRethrow.DeserializeObject<RentalDescription>(
@"{
[Test]
public void TestCreateRentalDescriptionsNoInfoElements()
{
var response = JsonConvertRethrow.DeserializeObject<RentalDescription>(
@"{
""rental_info"" : {
}
}");
Assert.That(
response.Create().InfoEntries,
Is.Not.Null);
}
}
Assert.That(
response.Create().InfoEntries,
Is.Not.Null);
}
}
}

View file

@ -5,14 +5,14 @@ using TINK.Repository.Response;
namespace TestShareeLib.Model.Connector.Updater
{
[TestFixture]
public class TestTariffDescriptionFactory
{
[Test]
public void TestCreateTariffDescription()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{
[TestFixture]
public class TestTariffDescriptionFactory
{
[Test]
public void TestCreateTariffDescription()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{
""eur_per_hour"" : ""10.50"",
""abo_eur_per_month"" : ""920.99"",
""free_hours"" : ""1.50"",
@ -20,32 +20,32 @@ namespace TestShareeLib.Model.Connector.Updater
""name"" : ""Tester Basic""
}");
Assert.That(
tariffDescription.Create().Name,
Is.EqualTo("Tester Basic"));
Assert.That(
tariffDescription.Create().Name,
Is.EqualTo("Tester Basic"));
Assert.That(
tariffDescription.Create().Id,
Is.EqualTo(5494));
Assert.That(
tariffDescription.Create().Id,
Is.EqualTo(5494));
Assert.That(
tariffDescription.Create().TariffEntries["1"].Value, // Free time per session
Is.EqualTo("1.50 hour(s)/day")); // Did not contain unit before switching signature from TariffDescription to TariffDescription2.
Assert.That(
tariffDescription.Create().TariffEntries["1"].Value, // Free time per session
Is.EqualTo("1.50 hour(s)/day")); // Did not contain unit before switching signature from TariffDescription to TariffDescription2.
Assert.That(
tariffDescription.Create().TariffEntries["2"].Value, // FeeEuroPerHour
Is.EqualTo("10.50 €/hour")); // Did not contain unit before switching signature from TariffDescription to TariffDescription2.
Assert.That(
tariffDescription.Create().TariffEntries["2"].Value, // FeeEuroPerHour
Is.EqualTo("10.50 €/hour")); // Did not contain unit before switching signature from TariffDescription to TariffDescription2.
Assert.That(
tariffDescription.Create().TariffEntries["4"].Value, // Abo euro per month
Is.EqualTo("920.99 €/month"));
}
Assert.That(
tariffDescription.Create().TariffEntries["4"].Value, // Abo euro per month
Is.EqualTo("920.99 €/month"));
}
[Test]
public void TestCreateTariffDescription_Name()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{
[Test]
public void TestCreateTariffDescription_Name()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{
""eur_per_hour"" : ""10.50"",
""abo_eur_per_month"" : ""920.99"",
""free_hours"" : ""1.50"",
@ -53,16 +53,16 @@ namespace TestShareeLib.Model.Connector.Updater
""name"" : ""Tester Basic""
}");
Assert.That(
tariffDescription.Create().Name,
Is.EqualTo("Tester Basic"));
}
Assert.That(
tariffDescription.Create().Name,
Is.EqualTo("Tester Basic"));
}
[Test]
public void TestCreateTariffDescription_Number()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{
[Test]
public void TestCreateTariffDescription_Number()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{
""eur_per_hour"" : ""10.50"",
""abo_eur_per_month"" : ""920.99"",
""free_hours"" : ""1.50"",
@ -70,16 +70,16 @@ namespace TestShareeLib.Model.Connector.Updater
""name"" : ""Tester Basic""
}");
Assert.That(
tariffDescription.Create().Id,
Is.EqualTo(5494));
}
Assert.That(
tariffDescription.Create().Id,
Is.EqualTo(5494));
}
[Test]
public void TestCreateTariffDescription_FreeTimePerSession()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{
[Test]
public void TestCreateTariffDescription_FreeTimePerSession()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{
""eur_per_hour"" : ""10.50"",
""abo_eur_per_month"" : ""920.99"",
""free_hours"" : ""1.50"",
@ -87,16 +87,16 @@ namespace TestShareeLib.Model.Connector.Updater
""name"" : ""Tester Basic""
}");
Assert.That(
tariffDescription.Create().TariffEntries["1"].Value, // Free time per session
Is.EqualTo("1.50 hour(s)/day")); // Did not contain unit before switching signature from TariffDescription to TariffDescription2.
}
Assert.That(
tariffDescription.Create().TariffEntries["1"].Value, // Free time per session
Is.EqualTo("1.50 hour(s)/day")); // Did not contain unit before switching signature from TariffDescription to TariffDescription2.
}
[Test]
public void TestCreateTariffDescription_FeeEuroPerHour()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{
[Test]
public void TestCreateTariffDescription_FeeEuroPerHour()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{
""eur_per_hour"" : ""10.50"",
""abo_eur_per_month"" : ""920.99"",
""free_hours"" : ""1.50"",
@ -104,16 +104,16 @@ namespace TestShareeLib.Model.Connector.Updater
""name"" : ""Tester Basic""
}");
Assert.That(
tariffDescription.Create().TariffEntries["2"].Value, // FeeEuroPerHour
Is.EqualTo("10.50 €/hour")); // Did not contain unit before switching signature from TariffDescription to TariffDescription2.
}
Assert.That(
tariffDescription.Create().TariffEntries["2"].Value, // FeeEuroPerHour
Is.EqualTo("10.50 €/hour")); // Did not contain unit before switching signature from TariffDescription to TariffDescription2.
}
[Test]
public void TestCreateTariffDescription_AboEuroPerMonth()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{
[Test]
public void TestCreateTariffDescription_AboEuroPerMonth()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{
""eur_per_hour"" : ""10.50"",
""abo_eur_per_month"" : ""920.99"",
""free_hours"" : ""1.50"",
@ -121,104 +121,104 @@ namespace TestShareeLib.Model.Connector.Updater
""name"" : ""Tester Basic""
}");
Assert.That(
tariffDescription.Create().TariffEntries["4"].Value, // Abo euro per month
Is.EqualTo("920.99 €/month"));
}
Assert.That(
tariffDescription.Create().TariffEntries["4"].Value, // Abo euro per month
Is.EqualTo("920.99 €/month"));
}
[Test]
public void TestCreateTariffDescription_Name_Empty()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{}");
[Test]
public void TestCreateTariffDescription_Name_Empty()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{}");
Assert.That(
tariffDescription.Create().Name,
Is.Null);
}
Assert.That(
tariffDescription.Create().Name,
Is.Null);
}
[Test]
public void TestCreateTariffDescription_Number_Empty()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{}");
[Test]
public void TestCreateTariffDescription_Number_Empty()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{}");
Assert.That(
tariffDescription.Create().Id,
Is.Null);
}
Assert.That(
tariffDescription.Create().Id,
Is.Null);
}
[Test]
public void TestCreateTariffDescription_FreeTimePerSession_Empty()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{}");
[Test]
public void TestCreateTariffDescription_FreeTimePerSession_Empty()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{}");
Assert.That(
tariffDescription.Create().TariffEntries.ContainsKey("1"), // Free time per session
Is.False);
}
Assert.That(
tariffDescription.Create().TariffEntries.ContainsKey("1"), // Free time per session
Is.False);
}
[Test]
public void TestCreateTariffDescription_FeeEuroPerHour_Empty()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{}");
[Test]
public void TestCreateTariffDescription_FeeEuroPerHour_Empty()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{}");
Assert.That(
tariffDescription.Create().TariffEntries.ContainsKey("2"), // FeeEuroPerHour
Is.False);
}
Assert.That(
tariffDescription.Create().TariffEntries.ContainsKey("2"), // FeeEuroPerHour
Is.False);
}
[Test]
public void TestCreateTariffDescription_AboEuroPerMonth_Empty()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{}");
[Test]
public void TestCreateTariffDescription_AboEuroPerMonth_Empty()
{
var tariffDescription = JsonConvertRethrow.DeserializeObject<TariffDescription>(
@"{}");
Assert.That(
tariffDescription.Create().TariffEntries.ContainsKey("4"), // Abo euro per month
Is.False);
}
Assert.That(
tariffDescription.Create().TariffEntries.ContainsKey("4"), // Abo euro per month
Is.False);
}
[Test]
public void TestCreateTariffDescription_Name_Null()
{
Assert.That(
TariffDescriptionFactory.Create(null).Name,
Is.Null);
}
[Test]
public void TestCreateTariffDescription_Name_Null()
{
Assert.That(
TariffDescriptionFactory.Create(null).Name,
Is.Null);
}
[Test]
public void TestCreateTariffDescription_Number_Null()
{
Assert.That(
TariffDescriptionFactory.Create(null).Id,
Is.Null);
}
[Test]
public void TestCreateTariffDescription_Number_Null()
{
Assert.That(
TariffDescriptionFactory.Create(null).Id,
Is.Null);
}
[Test]
public void TestCreateTariffDescription_FreeTimePerSession_Null()
{
Assert.That(
TariffDescriptionFactory.Create(null).TariffEntries.ContainsKey("1"), // Free time per session
Is.False);
}
[Test]
public void TestCreateTariffDescription_FreeTimePerSession_Null()
{
Assert.That(
TariffDescriptionFactory.Create(null).TariffEntries.ContainsKey("1"), // Free time per session
Is.False);
}
[Test]
public void TestCreateTariffDescription_FeeEuroPerHour_Null()
{
Assert.That(
TariffDescriptionFactory.Create(null).TariffEntries.ContainsKey("2"), // FeeEuroPerHour
Is.False);
}
[Test]
public void TestCreateTariffDescription_FeeEuroPerHour_Null()
{
Assert.That(
TariffDescriptionFactory.Create(null).TariffEntries.ContainsKey("2"), // FeeEuroPerHour
Is.False);
}
[Test]
public void TestCreateTariffDescription_AboEuroPerMonth_Null()
{
Assert.That(
TariffDescriptionFactory.Create(null).TariffEntries.ContainsKey("4"), // Abo euro per month
Is.False);
}
}
[Test]
public void TestCreateTariffDescription_AboEuroPerMonth_Null()
{
Assert.That(
TariffDescriptionFactory.Create(null).TariffEntries.ContainsKey("4"), // Abo euro per month
Is.False);
}
}
}

File diff suppressed because it is too large Load diff