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