Created
June 19, 2010 19:27
-
-
Save deurell/445204 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 | |
[Test(Description = "Added product shows up in repository with correct savestate")] | |
public void ExecutingCreateProductCommand_WithNewProduct_ShowsUpInRepository() | |
{ | |
// Given the user wants to create a new product on the Create Product View | |
var product = new Product("4242", "desc", ProductType.Assortment, "201001", "123", _dummyArticles, null, | |
1); | |
// When the user clicks the New button a CreateProductCommand is fired on the ViewModel | |
var viewModel = new ProductViewModel(product); | |
ICommand command = viewModel.CreateProductCommand; | |
command.Execute(null); | |
// Then the created product shows up in the Product repository and has savestate set to SaveState.New | |
Assert.True(Registry.Instance.ProductRepository.LoadedModels.Contains(product)); | |
Assert.That(product.State,Is.EqualTo(SaveState.New)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment