public async Task DisplayActionSheet_NullButtonAndOtherButtonPressed() { var service = new PageDialogServiceMock("other", _applicationProvider); var buttonPressed = false; var command = new DelegateCommand(() => buttonPressed = true); var button = ActionSheetButton.CreateButton("other", command); await service.DisplayActionSheetAsync(null, button, null); Assert.True(buttonPressed); }
public async Task DisplayActionSheet_CancelButtonPressed() { var service = new PageDialogServiceMock("cancel", _applicationProvider); var cancelButtonPressed = false; var cancelCommand = new DelegateCommand(() => cancelButtonPressed = true); var button = ActionSheetButton.CreateCancelButton("cancel", cancelCommand); await service.DisplayActionSheetAsync(null, button); Assert.True(cancelButtonPressed); }
public async Task DisplayActionSheet_NoButtonPressed() { var service = new PageDialogServiceMock(null); var buttonPressed = false; var cancelCommand = new DelegateCommand(() => buttonPressed = true); var button = ActionSheetButton.CreateCancelButton("cancel", cancelCommand); var destroyCommand = new DelegateCommand(() => buttonPressed = true); var destroyButton = ActionSheetButton.CreateDestroyButton("destroy", destroyCommand); await service.DisplayActionSheet(null, button, destroyButton); Assert.False(buttonPressed); }
public async Task DisplayActionSheetNoButtons_ShouldThrowException() { var service = new PageDialogServiceMock("cancel", _applicationProvider); var argumentException = await Assert.ThrowsAsync<ArgumentException>(() => service.DisplayActionSheetAsync(null, null)); Assert.Equal(typeof(ArgumentException), argumentException.GetType()); }