예제 #1
0
 public void TestDriverLifecycleExample()
 {
     // Given
     var driver = new DriverLifecycleExample(Uri, User, Password).Driver;
     using (var session = driver.Session())
     {
         // When & Then
         session.Run("RETURN 1").Single()[0].As<int>().Should().Be(1);
     }
 }
예제 #2
0
            public async Task TestDriverLifecycleExample()
            {
                // Given
                var driver  = new DriverLifecycleExample(Uri, User, Password).Driver;
                var session = driver.Session();

                try
                {
                    // When & Then
                    IStatementResultCursor result = await session.RunAsync("RETURN 1");

                    bool read = await result.FetchAsync();

                    read.Should().BeTrue();

                    result.Current[0].As <int>().Should().Be(1);
                }
                finally
                {
                    await session.CloseAsync();
                }
            }