Created
June 19, 2010 19:27
-
-
Save deurell/445205 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fire command and validate mediator | |
[Test(Description = "Executing DisplayArticlesViewCommand sends message with products articles [Mikael Deurell]")] | |
public void Executing_DisplayArticlesViewCommand_SendsDisplayArticleViewListWithProvidedArticles() | |
{ | |
// Given the user wants to display selected articles in a dialogue view | |
var sut = | |
new ProductViewModel(new Product("1", "desc", ProductType.Assortment, "10", "10", _dummyArticles, null, | |
0)); | |
int notify = 0; | |
ObservableCollection<ArticleViewModel> articlesReceived = null; | |
Messenger.Instance.Register(MessageType.DisplayArticleViewList, | |
(ObservableCollection<ArticleViewModel> articles) => | |
{ | |
articlesReceived = articles; | |
++notify; | |
}); | |
// When the user clicks button and trigger the execution of a DisplayArticleViewDialogueCommand | |
ICommand command = sut.DisplayArticleViewDialogueCommand; | |
command.Execute(null); | |
// Then the selected articles received to be displayed by the viewmodel are the same as the articles sent to the mediator | |
Assert.That(articlesReceived, Is.EqualTo(sut.Articles)); | |
Assert.That(notify, Is.EqualTo(1)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment