public void CanSwitchWhileDatasetIsInEditMode() { var proxy = new Mock <IProxyDataset>(); { proxy.Setup(p => p.IsEditMode) .Returns(false); } var dataset = new DatasetFacade(proxy.Object); var command = new SwitchDatasetToExecutingModeCommand(dataset); Assert.IsFalse(command.CanExecute(null)); }
public void SwitchToEditMode() { var proxy = new Mock <IProxyDataset>(); { proxy.Setup(p => p.SwitchToExecutingMode()) .Verifiable(); } var dataset = new DatasetFacade(proxy.Object); var command = new SwitchDatasetToExecutingModeCommand(dataset); command.Execute(null); proxy.Verify(p => p.SwitchToExecutingMode(), Times.Once()); }