mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-20 20:16:30 +02:00
Version 3.0.338
This commit is contained in:
parent
573fe77e12
commit
0468955d49
751 changed files with 62747 additions and 60672 deletions
|
@ -4,118 +4,118 @@ using NUnit.Framework;
|
|||
|
||||
namespace TINK.ViewModel.Settings
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestServicesViewModel
|
||||
{
|
||||
[Test]
|
||||
public void TestCtor()
|
||||
{
|
||||
var servicesViewModel = new ServicesViewModel(
|
||||
new List<string> {
|
||||
"ServiceA",
|
||||
"ServiceB",
|
||||
"ServiceB", // Dupes are removed
|
||||
[TestFixture]
|
||||
public class TestServicesViewModel
|
||||
{
|
||||
[Test]
|
||||
public void TestCtor()
|
||||
{
|
||||
var servicesViewModel = new ServicesViewModel(
|
||||
new List<string> {
|
||||
"ServiceA",
|
||||
"ServiceB",
|
||||
"ServiceB", // Dupes are removed
|
||||
"ServiceC" },
|
||||
new Dictionary<string, string> {
|
||||
{ "ServiceA", "Top service of type A" },
|
||||
{ "ServiceB", "Supertop service of type B" },
|
||||
{ "OldsService", "This entry is discarded" }},
|
||||
"ServiceB");
|
||||
new Dictionary<string, string> {
|
||||
{ "ServiceA", "Top service of type A" },
|
||||
{ "ServiceB", "Supertop service of type B" },
|
||||
{ "OldsService", "This entry is discarded" }},
|
||||
"ServiceB");
|
||||
|
||||
Assert.That(
|
||||
servicesViewModel.ServicesTextList,
|
||||
Is.EqualTo(new List<string> {
|
||||
"ServiceC",
|
||||
"Supertop service of type B",
|
||||
"Top service of type A" }).AsCollection);
|
||||
Assert.That(
|
||||
servicesViewModel.ServicesTextList,
|
||||
Is.EqualTo(new List<string> {
|
||||
"ServiceC",
|
||||
"Supertop service of type B",
|
||||
"Top service of type A" }).AsCollection);
|
||||
|
||||
Assert.That(
|
||||
servicesViewModel.Active,
|
||||
Is.EqualTo("ServiceB"));
|
||||
}
|
||||
Assert.That(
|
||||
servicesViewModel.Active,
|
||||
Is.EqualTo("ServiceB"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCtorInvalidActive()
|
||||
{
|
||||
Assert.That(
|
||||
() => new ServicesViewModel(
|
||||
new List<string> { "ServiceA", "ServiceB", "ServiceB", "ServiceC" },
|
||||
new Dictionary<string, string> { { "ServiceA", "Top service of type A" }, { "ServiceB", "Supertop service of type B" } },
|
||||
"ServiceX"),
|
||||
Throws.TypeOf<ArgumentException>());
|
||||
}
|
||||
[Test]
|
||||
public void TestCtorInvalidActive()
|
||||
{
|
||||
Assert.That(
|
||||
() => new ServicesViewModel(
|
||||
new List<string> { "ServiceA", "ServiceB", "ServiceB", "ServiceC" },
|
||||
new Dictionary<string, string> { { "ServiceA", "Top service of type A" }, { "ServiceB", "Supertop service of type B" } },
|
||||
"ServiceX"),
|
||||
Throws.TypeOf<ArgumentException>());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCtorInvalidServiceNames()
|
||||
{
|
||||
Assert.That(
|
||||
() => new ServicesViewModel(
|
||||
new List<string> { "ServiceA", "ServiceB", "ServiceC" },
|
||||
new Dictionary<string, string> { { "ServiceA", "Top fast" }, { "ServiceB", "Top fast" } },
|
||||
"ServiceB"),
|
||||
Throws.TypeOf<ArgumentException>());
|
||||
}
|
||||
[Test]
|
||||
public void TestCtorInvalidServiceNames()
|
||||
{
|
||||
Assert.That(
|
||||
() => new ServicesViewModel(
|
||||
new List<string> { "ServiceA", "ServiceB", "ServiceC" },
|
||||
new Dictionary<string, string> { { "ServiceA", "Top fast" }, { "ServiceB", "Top fast" } },
|
||||
"ServiceB"),
|
||||
Throws.TypeOf<ArgumentException>());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestGetActiveTextDisplayTextAvailable()
|
||||
{
|
||||
var servicesViewModel = new ServicesViewModel(
|
||||
new List<string> {
|
||||
"ServiceB"},
|
||||
new Dictionary<string, string> {
|
||||
{ "ServiceB", "Supertop service of type B" }},
|
||||
"ServiceB");
|
||||
[Test]
|
||||
public void TestGetActiveTextDisplayTextAvailable()
|
||||
{
|
||||
var servicesViewModel = new ServicesViewModel(
|
||||
new List<string> {
|
||||
"ServiceB"},
|
||||
new Dictionary<string, string> {
|
||||
{ "ServiceB", "Supertop service of type B" }},
|
||||
"ServiceB");
|
||||
|
||||
Assert.That(
|
||||
servicesViewModel.ActiveText,
|
||||
Is.EqualTo("Supertop service of type B"));
|
||||
}
|
||||
Assert.That(
|
||||
servicesViewModel.ActiveText,
|
||||
Is.EqualTo("Supertop service of type B"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestGetActiveTextNoDisplayText()
|
||||
{
|
||||
var servicesViewModel = new ServicesViewModel(
|
||||
new List<string> {
|
||||
"ServiceB"},
|
||||
new Dictionary<string, string>(),
|
||||
"ServiceB");
|
||||
[Test]
|
||||
public void TestGetActiveTextNoDisplayText()
|
||||
{
|
||||
var servicesViewModel = new ServicesViewModel(
|
||||
new List<string> {
|
||||
"ServiceB"},
|
||||
new Dictionary<string, string>(),
|
||||
"ServiceB");
|
||||
|
||||
Assert.That(
|
||||
servicesViewModel.ActiveText,
|
||||
Is.EqualTo("ServiceB"));
|
||||
}
|
||||
Assert.That(
|
||||
servicesViewModel.ActiveText,
|
||||
Is.EqualTo("ServiceB"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSetActiveText()
|
||||
{
|
||||
var servicesViewModel = new ServicesViewModel(
|
||||
new List<string> {
|
||||
"ServiceA",
|
||||
"ServiceB" },
|
||||
new Dictionary<string, string>(),
|
||||
"ServiceB")
|
||||
{
|
||||
ActiveText = "ServiceA"
|
||||
};
|
||||
[Test]
|
||||
public void TestSetActiveText()
|
||||
{
|
||||
var servicesViewModel = new ServicesViewModel(
|
||||
new List<string> {
|
||||
"ServiceA",
|
||||
"ServiceB" },
|
||||
new Dictionary<string, string>(),
|
||||
"ServiceB")
|
||||
{
|
||||
ActiveText = "ServiceA"
|
||||
};
|
||||
|
||||
Assert.That(
|
||||
servicesViewModel.ActiveText,
|
||||
Is.EqualTo("ServiceA"));
|
||||
}
|
||||
Assert.That(
|
||||
servicesViewModel.ActiveText,
|
||||
Is.EqualTo("ServiceA"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSetActiveTextInvalid()
|
||||
{
|
||||
var servicesViewModel = new ServicesViewModel(
|
||||
new List<string> {
|
||||
"ServiceA",
|
||||
"ServiceB" },
|
||||
new Dictionary<string, string>(),
|
||||
"ServiceB");
|
||||
[Test]
|
||||
public void TestSetActiveTextInvalid()
|
||||
{
|
||||
var servicesViewModel = new ServicesViewModel(
|
||||
new List<string> {
|
||||
"ServiceA",
|
||||
"ServiceB" },
|
||||
new Dictionary<string, string>(),
|
||||
"ServiceB");
|
||||
|
||||
Assert.That(
|
||||
() => servicesViewModel.ActiveText = "ServiceX",
|
||||
Throws.InstanceOf<ArgumentException>());
|
||||
}
|
||||
}
|
||||
Assert.That(
|
||||
() => servicesViewModel.ActiveText = "ServiceX",
|
||||
Throws.InstanceOf<ArgumentException>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue