public void TypePropertyIsNullWhenViewModelInstantiatedTest() { var catalogService = new CatalogMockService(); var catalogViewModel = new CatalogViewModel(catalogService); Assert.Null(catalogViewModel.Type); }
public void AddCatalogItemCommandIsNotNullTest() { var catalogService = new CatalogMockService(); var catalogViewModel = new CatalogViewModel(catalogService); Assert.NotNull(catalogViewModel.AddCatalogItemCommand); }
public void IsFilterPropertyIsFalseWhenViewModelInstantiatedTest() { var catalogService = new CatalogMockService(); var catalogViewModel = new CatalogViewModel(catalogService); Assert.False(catalogViewModel.IsFilter); }
public void FilterCommandIsNotNullTest() { var catalogService = new CatalogMockService(_dependencyService); var catalogViewModel = new CatalogViewModel(catalogService); Assert.NotNull(catalogViewModel.FilterCommand); }
public async Task GetFakeCatalogTypeTest() { var catalogMockService = new CatalogMockService(); var catalogType = await catalogMockService.GetCatalogTypeAsync(); Assert.NotEqual(0, catalogType.Count); }
public async Task GetFakeCatalogTypeTest() { var catalogMockService = new CatalogMockService(_dependencyService); var catalogType = await catalogMockService.GetCatalogTypeAsync(); Assert.NotEmpty(catalogType); }
public async Task GetFakeCatalogTest() { var catalogMockService = new CatalogMockService(); var catalog = await catalogMockService.GetCatalogAsync(); Assert.NotEmpty(catalog); }
public void BrandPropertyIsNullWhenViewModelInstantiatedTest() { var catalogService = new CatalogMockService(_dependencyService); var catalogViewModel = new CatalogViewModel(catalogService); Assert.Null(catalogViewModel.Brand); }
public void ClearFilterCommandIsNotNullTest() { var catalogService = new CatalogMockService(); var catalogViewModel = new CatalogViewModel(catalogService); Assert.NotNull(catalogViewModel.ClearFilterCommand); }
public async Task GetFakeBasketTest() { var catalogMockService = new CatalogMockService(); var result = await catalogMockService.GetCatalogAsync(); Assert.NotEmpty(result); }
public async Task TypesPropertyIsNotNullAfterViewModelInitializationTest() { var catalogService = new CatalogMockService(); var catalogViewModel = new CatalogViewModel(catalogService); await catalogViewModel.InitializeAsync(null); Assert.NotNull(catalogViewModel.Types); }
public async Task ProductsPropertyIsNotNullAfterViewModelInitializationTest() { var catalogService = new CatalogMockService(_dependencyService); var catalogViewModel = new CatalogViewModel(catalogService); await catalogViewModel.InitializeAsync(null); Assert.NotNull(catalogViewModel.Products); }
public async Task ClearFilterCommandResetsPropertiesTest() { var catalogService = new CatalogMockService(); var catalogViewModel = new CatalogViewModel(catalogService); await catalogViewModel.InitializeAsync(null); catalogViewModel.ClearFilterCommand.Execute(null); Assert.Null(catalogViewModel.Brand); Assert.Null(catalogViewModel.Type); Assert.NotNull(catalogViewModel.Products); }
public void AddCatalogItemCommandSendsAddProductMessageTest() { bool messageReceived = false; var catalogService = new CatalogMockService(); var catalogViewModel = new CatalogViewModel(catalogService); Xamarin.Forms.MessagingCenter.Subscribe <CatalogViewModel, CatalogItem>(this, MessageKeys.AddProduct, (sender, arg) => { messageReceived = true; }); catalogViewModel.AddCatalogItemCommand.Execute(null); Assert.True(messageReceived); }
public async Task SettingTypesPropertyShouldRaisePropertyChanged() { bool invoked = false; var catalogService = new CatalogMockService(); var catalogViewModel = new CatalogViewModel(catalogService); catalogViewModel.PropertyChanged += (sender, e) => { if (e.PropertyName.Equals("Types")) { invoked = true; } }; await catalogViewModel.InitializeAsync(null); Assert.True(invoked); }
public async Task FilterCommandSendsFilterMessageTest() { bool messageReceived = false; var catalogService = new CatalogMockService(); var catalogViewModel = new CatalogViewModel(catalogService); await catalogViewModel.InitializeAsync(null); catalogViewModel.Brand = catalogViewModel.Brands.FirstOrDefault(); catalogViewModel.Type = catalogViewModel.Types.FirstOrDefault(); Xamarin.Forms.MessagingCenter.Subscribe <CatalogViewModel>(this, MessageKeys.Filter, (sender) => { messageReceived = true; }); catalogViewModel.FilterCommand.Execute(null); Assert.True(messageReceived); }
public CatalogController(CatalogMockService catalogMockService) { _catalogService = catalogMockService; }