-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGraphClientPoolTests.cs
36 lines (32 loc) · 1013 Bytes
/
GraphClientPoolTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using CuriousGremlin;
using CuriousGremlin.Client;
using CuriousGremlin.AzureCosmosDB;
using CuriousGremlin.UnitTests;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace CuriousGremlin.AzureCosmosDB.UnitTests
{
[TestClass]
public class GraphClientPoolTests
{
[TestMethod]
public void AzureCosmosDB_ExecuteFromPool()
{
Func<IGraphClient> clientFactory = new Func<IGraphClient>(() =>
{
return TestDatabase.GetClient("graph_client_pool");
});
var pool = new GraphClientPool(clientFactory);
var query = VertexQuery.All();
var result = pool.Execute(query).Result;
Assert.IsNotNull(result);
Assert.AreEqual(0, result.Count());
Assert.AreEqual(pool.PoolSize, 1);
pool.Dispose();
Assert.AreEqual(pool.PoolSize, 0);
}
}
}