mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-15 22:56:37 +01:00
75 lines
2 KiB
C#
75 lines
2 KiB
C#
using NUnit.Framework;
|
|
using TINK.Model.Bikes.BikeInfoNS;
|
|
using TINK.ViewModel.Bikes.Bike;
|
|
|
|
namespace TestShareeLib.ViewModel.Bikes.Bike
|
|
{
|
|
[TestFixture]
|
|
public class TestTariffDescriptionViewModel
|
|
{
|
|
[Test]
|
|
public void TestCtor()
|
|
{
|
|
var model = new RentalDescription
|
|
{
|
|
Name = "Fancy Tarif",
|
|
Id = 47,
|
|
TariffEntries = new System.Collections.Generic.Dictionary<string, RentalDescription.TariffElement>
|
|
{
|
|
{ "23", new RentalDescription.TariffElement { Value = "Max Gebühr", Description = "9.00 € / Tag"} },
|
|
{ "24", new RentalDescription.TariffElement { Value = "Gratis Mietzeit", Description = "30 Min / Tag"} },
|
|
},
|
|
InfoEntries = new System.Collections.Generic.Dictionary<string, RentalDescription.InfoElement>
|
|
{
|
|
{ "15", new RentalDescription.InfoElement { Key = "Tracking", Value = "Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!" } },
|
|
}
|
|
};
|
|
|
|
var viewModel = new TariffDescriptionViewModel(model);
|
|
|
|
Assert.That(
|
|
viewModel.Name,
|
|
Is.EqualTo("Fancy Tarif"));
|
|
|
|
Assert.That(
|
|
viewModel.TariffEntries.Count,
|
|
Is.EqualTo(2));
|
|
|
|
Assert.That(
|
|
viewModel.InfoEntries.Count,
|
|
Is.EqualTo(1));
|
|
|
|
Assert.That(
|
|
viewModel.TarifEntry1.Value,
|
|
Is.EqualTo("Max Gebühr"));
|
|
|
|
Assert.That(
|
|
viewModel.TarifEntry1.Description,
|
|
Is.EqualTo("9.00 € / Tag"));
|
|
|
|
Assert.That(
|
|
viewModel.TarifEntry2.Value,
|
|
Is.EqualTo("Gratis Mietzeit"));
|
|
|
|
Assert.That(
|
|
viewModel.TarifEntry2.Description,
|
|
Is.EqualTo("30 Min / Tag"));
|
|
|
|
Assert.That(
|
|
viewModel.TarifEntry3.Value,
|
|
Is.Empty);
|
|
|
|
Assert.That(
|
|
viewModel.TarifEntry3.Description,
|
|
Is.Empty);
|
|
|
|
Assert.That(
|
|
viewModel.InfoEntry1,
|
|
Is.EqualTo("Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!"));
|
|
|
|
Assert.That(
|
|
viewModel.InfoEntry2,
|
|
Is.Empty);
|
|
}
|
|
}
|
|
}
|