コード例 #1
0
        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));
        }
コード例 #2
0
        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());
        }