public void TitleIsSetToSanitizedName() { var vm = new ReactiveMockViewModel(TestOutputHelper); TestOutputHelper.WriteLine(vm.Title); Assert.Equal("Reactive Mock", vm.Title); }
public async Task ValidNavigation_DoesNotUsePageDialogService() { var navService = new NavigationServiceMock(); var dialogService = new PageDialogServiceMock(); var logger = new XunitLogger(TestOutputHelper); var vm = new ReactiveMockViewModel(navService, dialogService, logger); // Assert.True(vm.NavigateCommand.CanExecute("good")); await vm.NavigateCommand.Execute("good"); Assert.Null(dialogService.Title); Assert.Null(dialogService.Message); }
public async Task ValidNavigation_DoesNotUsePageDialogService() { var navService = new NavigationServiceMock(); var dialogService = new PageDialogServiceMock(); var logger = new XunitLogger(TestOutputHelper); var baseServices = new BaseServices(navService, Mock.Of <IDialogService>(), dialogService, logger, Mock.Of <IEventAggregator>(), Mock.Of <IDeviceService>(), new ResxLocalize()); var vm = new ReactiveMockViewModel(baseServices); // Assert.True(vm.NavigateCommand.CanExecute("good")); await vm.NavigateCommand.Execute("good"); Assert.Null(dialogService.Title); Assert.Null(dialogService.Message); }
public async Task SetIsBusy_UpdatesIsNotBusy() { var vm = new ReactiveMockViewModel(TestOutputHelper); Assert.False(vm.IsToggled); await vm.ToggleIsBusyCommand.Execute(); Assert.True(vm.IsToggled); Assert.True(vm.IsBusy); Assert.False(vm.IsNotBusy); await vm.ToggleIsBusyCommand.Execute(); Assert.False(vm.IsToggled); Assert.False(vm.IsBusy); Assert.True(vm.IsNotBusy); }
public async Task InvalidNavigation_UsesPageDialogService() { var navService = new NavigationServiceMock(); var dialogService = new PageDialogServiceMock(); var logger = new XunitLogger(TestOutputHelper); var vm = new ReactiveMockViewModel(navService, dialogService, logger); // Assert.True(vm.NavigateCommand.CanExecute("bad")); await vm.NavigateCommand.Execute("bad"); Assert.Equal(ToolkitResources.Error, dialogService.Title); var errorMessage = new Exception("bad").ToErrorMessage(); var dialogMessage = string.Format(ToolkitResources.AlertErrorMessageTemplate, errorMessage, vm.CorrelationId); Assert.NotNull(vm.CorrelationId); Assert.Contains(dialogMessage, dialogService.Message); }
public void InitialIsNotBusy_IsTrue() { var vm = new ReactiveMockViewModel(TestOutputHelper); Assert.True(vm.IsNotBusy); }