Пример #1
0
        public void ReturnsAllDatabasesUrl()
        {
            var couchUriBuilder = new CouchUriBuilder(mockCouchConfiguration.Object);
            const string expectedUrl = "http://somecouchserver/_all_dbs";;

            var documentUri = couchUriBuilder.ForAllDatabases();

            Assert.That(documentUri.AbsoluteUri, Is.EqualTo(expectedUrl));
        }
Пример #2
0
        public void DocumentUriIncludesDocumentId()
        {
            const string documentId = "1";
            var couchUriBuilder = new CouchUriBuilder(mockCouchConfiguration.Object);
            var expectedUrl = new Uri(testCouchDatabaseUri.AbsoluteUri + string.Format("/{0}", documentId)).AbsoluteUri;

            var documentUri = couchUriBuilder.DocumentUri(documentId);

            Assert.That(documentUri.AbsoluteUri, Is.EqualTo(expectedUrl));
        }
Пример #3
0
        public void ViewUriIncludesViewNameAndDesignDocumentName()
        {
            const string designDocumentName = "DesignName";
            const string viewName = "viewName";
            var couchUriBuilder = new CouchUriBuilder(mockCouchConfiguration.Object);
            var expectedUrl = string.Format("http://somecouchserver/somedatabase/_design/{0}/_view/{1}",
                                            designDocumentName, viewName);

            var viewUri = couchUriBuilder.ForView(designDocumentName, viewName);

            Assert.That(viewUri.AbsoluteUri, Is.EqualTo(expectedUrl));
        }
Пример #4
0
        public void ServerUriIsTheSameAsTheCouchConfiguration()
        {
            var couchUriBuilder = new CouchUriBuilder(mockCouchConfiguration.Object);

            Assert.That(couchUriBuilder.ServerUri, Is.EqualTo(mockCouchConfiguration.Object.ServerUri));
        }