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