Beispiel #1
0
        public void Can_Perform_Move_On_ScriptRepository()
        {
            const string content = "/// <reference name=\"MicrosoftAjax.js\"/>";

            // Arrange
            using (IScope scope = ScopeProvider.CreateScope())
            {
                IScriptRepository repository = CreateRepository();

                IScript script = new Script("test-move-script.js")
                {
                    Content = content
                };
                repository.Save(script);

                // Act
                script      = repository.Get("test-move-script.js");
                script.Path = "moved/test-move-script.js";
                repository.Save(script);

                bool existsOld = repository.Exists("test-move-script.js");
                bool existsNew = repository.Exists("moved/test-move-script.js");

                script = repository.Get("moved/test-move-script.js");

                // Assert
                Assert.IsNotNull(script);
                Assert.IsFalse(existsOld);
                Assert.IsTrue(existsNew);
                Assert.AreEqual(content, script.Content);
            }
        }
Beispiel #2
0
        public void Can_Perform_Exists_On_ScriptRepository()
        {
            // Arrange
            using (IScope scope = ScopeProvider.CreateScope())
            {
                IScriptRepository repository = CreateRepository();

                // Act
                bool exists = repository.Exists("test-script.js");

                // Assert
                Assert.That(exists, Is.True);
            }
        }
Beispiel #3
0
        public void Can_Perform_Delete_On_ScriptRepository()
        {
            // Arrange
            using (IScope scope = ScopeProvider.CreateScope())
            {
                IScriptRepository repository = CreateRepository();

                // Act
                IScript script = repository.Get("test-script.js");
                repository.Delete(script);

                // Assert
                Assert.IsFalse(repository.Exists("test-script.js"));
            }
        }