public void CanCreateViewModelOk() { // Arrange var service = new Mock <IConfirmationService>(); // Act var vm = new ServiceInjectionCallAndReturnViewModel(service.Object); // Assert Assert.IsNotNull(vm); }
public void CanCancelExecutionOfSomeOperation() { // Arrange var service = new Mock <IConfirmationService>(); service.Setup(m => m.AskConfirmation(It.IsAny <string>())).ReturnsAsync(false); var vm = new ServiceInjectionCallAndReturnViewModel(service.Object); var startingNumberOfOperation = vm.Operations.Count; // Act vm.ExecuteSomeOperationCommand.Execute(null); // Assert Assert.AreEqual(startingNumberOfOperation, vm.Operations.Count); }