Version 3.0.381

This commit is contained in:
Anja 2024-04-09 12:53:23 +02:00
parent f963c0a219
commit 3a363acf3a
1525 changed files with 60589 additions and 125098 deletions

View file

@ -0,0 +1,57 @@
using System.Collections.Generic;
using NUnit.Framework;
using ShareeBike.ViewModel.MiniSurvey.Question;
namespace SharedBusinessLogic.Tests.ViewModel.MiniSurvey.Question
{
[TestFixture]
public class TestCheckOneViewModel
{
[Test]
public void TestCtor()
{
var vm = new CheckOneViewModel(
new KeyValuePair<string, string>("q5", "wie ist das Wetter heute"),
new Dictionary<string, string> { { "opt1", "regnerisch" }, { "opt2", "bewölkt" }, { "opt3", "sonnig" } });
Assert.That(
vm.Question.Key,
Is.EqualTo("q5"),
"Key is essential for COPRI request.");
Assert.That(
vm.QuestionText,
Is.EqualTo("wie ist das Wetter heute"),
"Question shown to user.");
Assert.That(
string.Join(',', vm.AnswersText),
Is.EqualTo("regnerisch,bewölkt,sonnig"),
"Gui must show three options.");
Assert.That(
vm.AnswerText,
Is.EqualTo(null),
"GUI should not show selected entry.");
Assert.That(
vm.Answer.Key,
Is.EqualTo(null),
"View model shold not hold any selected endtry.");
}
[Test]
public void TestSelected()
{
var vm = new CheckOneViewModel(
new KeyValuePair<string, string>("q5", "wie ist das Wetter heute"),
new Dictionary<string, string> { { "opt1", "regnerisch" }, { "opt2", "bewölkt" }, { "opt3", "sonnig" } });
vm.AnswerText = "sonnig"; // Member is called if user selects an entry.
Assert.That(
vm.Answer.Key,
Is.EqualTo("opt3"),
"Key matching to selected item must be set as answer.");
}
}
}

View file

@ -0,0 +1,52 @@
using System.Collections.Generic;
using NUnit.Framework;
using ShareeBike.ViewModel.MiniSurvey.Question;
namespace SharedBusinessLogic.Tests.ViewModel.MiniSurvey.Question
{
[TestFixture]
class TestFreeTextViewModel
{
[Test]
public void TestCtor()
{
var vm = new FreeTextViewModel(
new KeyValuePair<string, string>("q9", "War das essen heute gut?"));
Assert.That(
vm.Question.Key,
Is.EqualTo("q9"),
"Key is essential for COPRI request.");
Assert.That(
vm.QuestionText,
Is.EqualTo("War das essen heute gut?"),
"Question shown to user.");
Assert.That(
vm.AnswerText,
Is.EqualTo(null),
"GUI should not show selected entry.");
Assert.That(
vm.Answer.Key,
Is.EqualTo(null),
"View model shold not hold any selected endtry.");
}
[Test]
public void TestSelected()
{
var vm = new FreeTextViewModel(
new KeyValuePair<string, string>("q9", "War das essen heute gut?"));
vm.AnswerText = "Sehr wohlschmeckend!"; // Member is called if user enters text.
Assert.That(
vm.Answer.Key,
Is.EqualTo("Sehr wohlschmeckend!"),
"Key is the answer for COPRI.");
}
}
}