public void Can_Perform_Delete()
        {
            // Arrange
            using (ScopeProvider.CreateScope())
            {
                var repository = new StylesheetRepository(_fileSystems);

                // Act
                var stylesheet = new Stylesheet("test-delete.css") { Content = "body { color:#000; } .bold {font-weight:bold;}" };
                repository.Save(stylesheet);


                repository.Delete(stylesheet);


                //Assert
                Assert.That(_fileSystem.FileExists("test-delete.css"), Is.False);
            }
        }
Пример #2
0
        public void Can_Perform_Delete_On_StylesheetRepository()
        {
            // Arrange
            var provider   = new FileUnitOfWorkProvider();
            var unitOfWork = provider.GetUnitOfWork();
            var repository = new StylesheetRepository(unitOfWork, _fileSystem);

            // Act
            var stylesheet = new Stylesheet("test-delete.css")
            {
                Content = "body { color:#000; } .bold {font-weight:bold;}"
            };

            repository.AddOrUpdate(stylesheet);
            unitOfWork.Commit();

            repository.Delete(stylesheet);
            unitOfWork.Commit();

            //Assert
            Assert.That(_fileSystem.FileExists("test-delete.css"), Is.False);
        }
        public void Can_Perform_Delete_On_StylesheetRepository()
        {
            // Arrange
            var provider = new FileUnitOfWorkProvider();
            var unitOfWork = provider.GetUnitOfWork();
            var repository = new StylesheetRepository(unitOfWork, _fileSystem);

            // Act
            var stylesheet = new Stylesheet("test-delete.css") { Content = "body { color:#000; } .bold {font-weight:bold;}" };
            repository.AddOrUpdate(stylesheet);
            unitOfWork.Commit();

            repository.Delete(stylesheet);
            unitOfWork.Commit();

            //Assert
            Assert.That(_fileSystem.FileExists("test-delete.css"), Is.False);
        }