Exemplo n.º 1
0
        public void DeleteWithUndeletableDataset()
        {
            var dataset = new Mock <IProxyDataset>();
            {
                dataset.Setup(d => d.CanBeDeleted)
                .Returns(false);
            }

            var facade = new ScriptFrontEndDatasetFacade(new ScriptBackEndDatasetFacade(new DatasetFacade(dataset.Object)));

            Assert.Throws <CannotDeleteDatasetException>(() => facade.Delete());
        }
Exemplo n.º 2
0
        public void Delete()
        {
            var dataset = new Mock <IProxyDataset>();
            {
                dataset.Setup(d => d.CanBeDeleted)
                .Returns(true);

                dataset.Setup(d => d.Delete())
                .Verifiable();
            }

            var facade = new ScriptFrontEndDatasetFacade(new ScriptBackEndDatasetFacade(new DatasetFacade(dataset.Object)));

            facade.Delete();

            dataset.Verify(d => d.Delete(), Times.Once());
        }