public void TestCorrectQueryWithDatabase()
        {
            var parameters = new DeleteItemByQueryParameters(this.sessionConfig, this.scopeParameters, this.database, this.query);

            var url = this.builder.GetUrlForRequest(parameters);

            Assert.AreEqual("http://testurl/-/item/v1?query=%2fSitecore%2fContent%2f%2a&sc_database=master", url);
        }
        public void TestCorrectFastQuery()
        {
            scopeParameters.AddScope(ScopeType.Children);

            var parameters = new DeleteItemByQueryParameters(this.sessionConfig, this.scopeParameters, null, this.fastQuery);

            var url = this.builder.GetUrlForRequest(parameters);

            Assert.AreEqual("http://testurl/-/item/v1?query=fast%3a%2fsitecore%2fcontent%2fHome%2fProducts%2f%2a%5b%40%40name%20%3d%20%27Hammer%27%5d&scope=c", url);
        }
        public void TestCorrectQueryWithScope()
        {
            scopeParameters.AddScope(ScopeType.Children);

            var parameters = new DeleteItemByQueryParameters(this.sessionConfig, this.scopeParameters, null, this.query);

            var url = this.builder.GetUrlForRequest(parameters);

            Assert.AreEqual("http://testurl/-/item/v1?query=%2fSitecore%2fContent%2f%2a&scope=c", url);
        }
        public void TestNullQuery()
        {
            TestDelegate action = () =>
            {
                var parameters = new DeleteItemByQueryParameters(this.sessionConfig, this.scopeParameters, this.database, null);

                this.builder.GetUrlForRequest(parameters);
            };

            Assert.Throws <ArgumentNullException>(action);
        }