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_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 DisplayActionSheetNoButtons_ShouldThrowException() { var service = new PageDialogServiceMock("cancel", _applicationProvider); var argumentException = await Assert.ThrowsAsync<ArgumentException>(() => service.DisplayActionSheetAsync(null, null)); Assert.Equal(typeof(ArgumentException), argumentException.GetType()); }