public async Task Pies_ShouldNotBeNullAfterInitializeAsync()
        {
            //Arrange
            _catalogDataServiceMock.Setup(service => service.GetAllPiesAsync()).ReturnsAsync(new List <Pie>
            {
                new Pie()
            });

            //Act
            await _model.InitializeAsync(null);

            //Assert
            Assert.That(_model.Pies, Is.Not.Null);
        }
예제 #2
0
        public async Task Pies_All_Get_Loaded_After_InitializeAsync_Test()
        {
            var mockConnectionService  = new Mock <IConnectionService>();
            var mockNavigationService  = new Mock <INavigationService>();
            var mockDialogService      = new Mock <IDialogService>();
            var mockCatalogDataService = new MockCatalogDataService();

            var pieCatalogViewModel =
                new PieCatalogViewModel(
                    mockConnectionService.Object,
                    mockNavigationService.Object,
                    mockDialogService.Object,
                    mockCatalogDataService);
            await pieCatalogViewModel.InitializeAsync(null);

            Assert.Equal(10, pieCatalogViewModel.Pies.Count);
        }
예제 #3
0
        public async Task Pies_Not_Null_After_InitializeAsync_Test()
        {
            var mockConnectionService  = new Mock <IConnectionService>();
            var mockNavigationService  = new Mock <INavigationService>();
            var mockDialogService      = new Mock <IDialogService>();
            var mockCatalogDataService = new MockCatalogDataService();

            var pieCatalogViewModel =
                new PieCatalogViewModel(
                    mockConnectionService.Object,
                    mockNavigationService.Object,
                    mockDialogService.Object,
                    mockCatalogDataService);

            await pieCatalogViewModel.InitializeAsync(null);

            Assert.NotNull(pieCatalogViewModel.Pies);
        }