Fix filling in comments.
- VERBESSERT: Fehler bei der Kommentaraufforderung wurden behoben.
This commit is contained in:
@ -30,6 +30,7 @@ namespace Tests.Controller.Comments
|
||||
[Test]
|
||||
public void CreateCommentIfDoesNotExist()
|
||||
{
|
||||
CommentPool.Default.Reset();
|
||||
int n = CommentPool.Default.Count;
|
||||
ItemComment i = CommentPool.Default.GetCommentFor("item \"<>\"");
|
||||
Assert.AreEqual(n + 1, CommentPool.Default.Count);
|
||||
|
@ -38,5 +38,39 @@ namespace Tests.ViewModels
|
||||
Assert.AreEqual(comment.Suffix, vm.Suffix);
|
||||
Assert.AreEqual(comment.Value, vm.Value);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EnterComment()
|
||||
{
|
||||
ItemComment comment = new ItemComment("TAC", "(Ziel-Talspiegel: ", "", "µg/l)");
|
||||
ItemCommentViewModel vm = new ItemCommentViewModel(comment);
|
||||
vm.Value = "8-10";
|
||||
bool eventRaised = false;
|
||||
vm.RequestCloseView += (sender, args) =>
|
||||
{
|
||||
eventRaised = true;
|
||||
};
|
||||
vm.SaveCommand.Execute(null);
|
||||
Assert.IsTrue(eventRaised, "Event was not raised.");
|
||||
Assert.IsFalse(comment.IsCancelled, "Comment.IsCancelled should be false");
|
||||
Assert.AreEqual("8-10", comment.Value);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CancelComment()
|
||||
{
|
||||
ItemComment comment = new ItemComment("TAC", "(Ziel-Talspiegel: ", "default", "µg/l)");
|
||||
ItemCommentViewModel vm = new ItemCommentViewModel(comment);
|
||||
vm.Value = "blabla";
|
||||
bool eventRaised = false;
|
||||
vm.RequestCloseView += (sender, args) =>
|
||||
{
|
||||
eventRaised = true;
|
||||
};
|
||||
vm.CloseViewCommand.Execute(null);
|
||||
Assert.IsTrue(eventRaised, "Event was not raised.");
|
||||
Assert.IsTrue(comment.IsCancelled, "Comment.IsCancelled should be true");
|
||||
Assert.AreEqual("default", comment.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user