public void ItIsCreatedWithAnEmptySearchString() { var shoppingCart = new MultiSelectSearch( "Label", "Name", _searchService.Object, new ObservableCollection<ISearchablePromptItem>()); Assert.AreEqual(string.Empty, shoppingCart.SearchString); }
public void ItIsCreatedWithAnEmptySearchString() { var shoppingCart = new MultiSelectSearch( "Label", "Name", _searchService.Object, new ObservableCollection <ISearchablePromptItem>()); Assert.AreEqual(string.Empty, shoppingCart.SearchString); }
public void ItSetsTheAvailableItemsToTheSearchServiceGetAllWhenTheShoppingCartIsConstructed() { var expected = A.ObservableCollection(Mock.Of <ISearchablePromptItem>()); _searchService .Setup(s => s.GetAll()) .Returns(expected); var shoppingCart = new MultiSelectSearch( "label", "name", _searchService.Object, new ObservableCollection <ISearchablePromptItem>()); Assert.AreEqual(expected, shoppingCart.AvailableItems); }
public void ItUsesTheMultiSelectProviderWhenTheViewModelIsAMultiSelect() { var viewModel = new MultiSelectSearch( "name", "label", Mock.Of <ISearchService>(), new ObservableCollection <ISearchablePromptItem>()); var expected = new UserControl(); _multiSelectViewProvider.Setup(p => p.Get(viewModel)).Returns(expected); var actual = _provider.Get(viewModel); Assert.AreEqual(actual, expected); }
public void ItSetsTheAvailableItemsToTheSearchServiceGetAllWhenTheShoppingCartIsConstructed() { var expected = A.ObservableCollection(Mock.Of<ISearchablePromptItem>()); _searchService .Setup(s => s.GetAll()) .Returns(expected); var shoppingCart = new MultiSelectSearch( "label", "name", _searchService.Object, new ObservableCollection<ISearchablePromptItem>()); Assert.AreEqual(expected, shoppingCart.AvailableItems); }
public void ItSetsTheAvailableItemsToTheResultOfTheSearchServiceWhenTheSearchCommandIsExecuted() { var expected = A.ObservableCollection(Mock.Of <ISearchablePromptItem>()); const string searchString = "Search String"; _searchService .Setup(s => s.Search(searchString)) .Returns(expected); var shoppingCart = new MultiSelectSearch( "label", "name", _searchService.Object, new ObservableCollection <ISearchablePromptItem>()); shoppingCart.SearchString = searchString; shoppingCart.Search.Execute(null); Assert.AreEqual(expected, shoppingCart.AvailableItems); }
public void ItSetsTheAvailableItemsToTheResultOfTheSearchServiceWhenTheSearchCommandIsExecuted() { var expected = A.ObservableCollection(Mock.Of<ISearchablePromptItem>()); const string searchString = "Search String"; _searchService .Setup(s => s.Search(searchString)) .Returns(expected); var shoppingCart= new MultiSelectSearch( "label", "name", _searchService.Object, new ObservableCollection<ISearchablePromptItem>()); shoppingCart.SearchString = searchString; shoppingCart.Search.Execute(null); Assert.AreEqual(expected, shoppingCart.AvailableItems); }