public void DeleteWithUndeletableDataset() { var dataset = new Mock <IProxyDataset>(); { dataset.Setup(d => d.CanBeDeleted) .Returns(false); } var facade = new DatasetFacadeForScripts(new DatasetFacade(dataset.Object)); Assert.Throws <CannotDeleteDatasetException>(() => facade.Delete()); }
public void Delete() { var dataset = new Mock <IProxyDataset>(); { dataset.Setup(d => d.CanBeDeleted) .Returns(true); dataset.Setup(d => d.Delete()) .Verifiable(); } var facade = new DatasetFacadeForScripts(new DatasetFacade(dataset.Object)); facade.Delete(); dataset.Verify(d => d.Delete(), Times.Once()); }
public void DeleteWithUndeletableDataset() { var dataset = new Mock<IProxyDataset>(); { dataset.Setup(d => d.CanBeDeleted) .Returns(false); } var facade = new DatasetFacadeForScripts(new DatasetFacade(dataset.Object)); Assert.Throws<CannotDeleteDatasetException>(() => facade.Delete()); }
public void Delete() { var dataset = new Mock<IProxyDataset>(); { dataset.Setup(d => d.CanBeDeleted) .Returns(true); dataset.Setup(d => d.Delete()) .Verifiable(); } var facade = new DatasetFacadeForScripts(new DatasetFacade(dataset.Object)); facade.Delete(); dataset.Verify(d => d.Delete(), Times.Once()); }