コード例 #1
0
        public void Execute_NullString_ScalarReturned()
        {
            GraphClient           client           = new GraphClientFactory().Instantiate(ConnectionStringReader.GetLocaleGraph()) as GraphClient;
            var                   statement        = Mock.Of <IQuery>(x => x.Statement == "g.V('thomas').values('lastName')");
            GraphCommandOperation commandOperation = new GraphCommandFactory().Instantiate(client, statement, null).Implementation as GraphCommandOperation;

            var engine = new GraphExecutionEngine(client.CreateClientOperation(), commandOperation);

            var count = engine.ExecuteScalar();

            Assert.That(count, Is.Null);
        }
コード例 #2
0
        public void Execute_String_ScalarReturned()
        {
            GraphClient           session       = new GraphClientFactory().Instantiate(ConnectionStringReader.GetLocaleGraph()) as GraphClient;
            var                   statement     = Mock.Of <IQuery>(x => x.Statement == "g.V('mary').values('lastName')");
            GraphCommandOperation cosmosdbQuery = new GraphCommandFactory().Instantiate(session, statement, null).Implementation as GraphCommandOperation;

            var engine = new GraphExecutionEngine(session.CreateClientOperation(), cosmosdbQuery);

            var count = engine.ExecuteScalar();

            Assert.That(count, Is.EqualTo("Andersen"));
        }