Exemplo n.º 1
0
        public void InstantiateUnderlyingSession_CosmosDbConnectionString_ISession()
        {
            var factory = new GremlinLikeClientFactory();
            var client  = factory.Instantiate($@"Hostname=your-endpoint.gremlin.cosmosdb.azure.com;port=443;EnableSsl=true;Username=/dbs/database/colls/;password=p@ssw0rd;api=gremlin");

            Assert.That(client.UnderlyingSessionType, Is.EqualTo(typeof(GremlinClientOperation)));
        }
Exemplo n.º 2
0
        public void Instantiate_GremlinLikeConnectionString_CorrectUsername()
        {
            var factory       = new GremlinLikeClientFactory();
            var session       = factory.Instantiate(GremlinLikeConnectionString);
            var gremlinClient = session as GremlinClient;

            Assert.That(gremlinClient.Username, Is.EqualTo("/dbs/myDatabase/colls/myCollection"));
        }
Exemplo n.º 3
0
        public void Instantiate_GremlinLikeConnectionString_CorrectEnableSsl()
        {
            var factory       = new GremlinLikeClientFactory();
            var session       = factory.Instantiate(GremlinLikeConnectionString);
            var gremlinClient = session as GremlinClient;

            Assert.That(gremlinClient.EnableSsl, Is.EqualTo(true));
        }
Exemplo n.º 4
0
        public void Instantiate_GremlinLikeConnectionString_CorrectPassword()
        {
            var factory       = new GremlinLikeClientFactory();
            var session       = factory.Instantiate(GremlinLikeConnectionString);
            var gremlinClient = session as GremlinClient;

            Assert.That(gremlinClient.Password, Is.EqualTo("xLNOQPTaBpDrCxMoUTFVavrtnjkpSw5qaVbbxSazCtKNFopFjAZE9aeLKAdCuiQSqTUaRhffFGrJKJA89GTsdg=="));
        }
Exemplo n.º 5
0
        public void Instantiate_GremlinLikeConnectionString_CorrectPort()
        {
            var factory       = new GremlinLikeClientFactory();
            var session       = factory.Instantiate(GremlinLikeConnectionString);
            var gremlinClient = session as GremlinClient;

            Assert.That(gremlinClient.Port, Is.EqualTo(443));
        }
Exemplo n.º 6
0
        public void Instantiate_GremlinLikeConnectionString_CorrectHostName()
        {
            var factory       = new GremlinLikeClientFactory();
            var session       = factory.Instantiate(GremlinLikeConnectionString);
            var gremlinClient = session as GremlinClient;

            Assert.That(gremlinClient.Hostname, Is.EqualTo("my-endpoint.documents.azure.com"));
        }
Exemplo n.º 7
0
        public void Instantiate_GremlinConnectionString_GremlinClient()
        {
            var factory = new GremlinLikeClientFactory();
            var session = factory.Instantiate($@"Hostname=your-endpoint.gremlin.cosmosdb.azure.com;port=443;EnableSsl=true;Username=/dbs/database/colls/collection;password=p@ssw0rd;api=gremlin");

            Assert.That(session, Is.Not.Null);
            Assert.That(session, Is.TypeOf <GremlinClient>());
        }
Exemplo n.º 8
0
        public void Instantiate_GremlinShortConnectionString_CorrectUsername()
        {
            var factory       = new GremlinLikeClientFactory();
            var session       = factory.Instantiate(GremlinShortConnectionString);
            var gremlinClient = session as GremlinClient;

            Assert.That(gremlinClient.Username, Is.EqualTo("admin"));
        }
Exemplo n.º 9
0
        public void Instantiate_GremlinShortConnectionString_CorrectPassword()
        {
            var factory       = new GremlinLikeClientFactory();
            var session       = factory.Instantiate(GremlinShortConnectionString);
            var gremlinClient = session as GremlinClient;

            Assert.That(gremlinClient.Password, Is.EqualTo("p@ssw0rd"));
        }
Exemplo n.º 10
0
        public void InstantiateCreate_CosmosDbConnectionString_ISession()
        {
            var factory           = new GremlinLikeClientFactory();
            var client            = factory.Instantiate($@"Hostname=your-endpoint.gremlin.cosmosdb.azure.com;port=443;EnableSsl=true;Username=/dbs/database/colls/;password=p@ssw0rd;api=gremlin");
            var underlyingSession = client.CreateNew();

            Assert.That(underlyingSession, Is.Not.Null);
            Assert.That(underlyingSession, Is.AssignableTo <GremlinClientOperation>());
        }