mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-12 13:36:26 +01:00
e321764119
Minor fiexes.
54 lines
1.5 KiB
C#
54 lines
1.5 KiB
C#
using NUnit.Framework;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using TINK.ViewModel.MiniSurvey.Question;
|
|
|
|
namespace TestShareeLib.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.");
|
|
}
|
|
|
|
}
|
|
}
|