public void Setup()
        {
            var connectionServiceMock = new Mock <IConnectionService>();

            _navigationServiceMock = new Mock <INavigationService>();
            var dialogServiceMock = new Mock <IDialogService>();

            _catalogDataServiceMock = new Mock <ICatalogDataService>();
            _model = new PieCatalogViewModel(connectionServiceMock.Object,
                                             _navigationServiceMock.Object,
                                             dialogServiceMock.Object,
                                             _catalogDataServiceMock.Object);
        }
Beispiel #2
0
        public void PieTappedCommand_Not_Null_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);

            Assert.NotNull(pieCatalogViewModel.PieTappedCommand);
        }
Beispiel #3
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);
        }
Beispiel #4
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);
        }
Beispiel #5
0
        public void Return_Not_Null_Pies()
        {
            var connectivityMock       = new Mock <IConnectionService>();
            var dialogogMock           = new Mock <IDialogService>();
            var navigationMock         = new Mock <INavigationService>();
            var catalogDataServiceMock = new Mock <ICatalogDataService>();

            var pieDetailViewModel = new PieCatalogViewModel(
                connectivityMock.Object,
                navigationMock.Object,
                dialogogMock.Object,
                catalogDataServiceMock.Object
                );

            var pies = pieDetailViewModel.Pies;

            Assert.NotNull(pies);
        }