示例#1
0
        public async Task GetRoutingTableShouldThrowOnNullConnectionObject()
        {
            var v4_3 = new BoltProtocolV4_3(new Dictionary <string, string> {
                { "ContextKey", "ContextValue" }
            });

            var ex = await Xunit.Record.ExceptionAsync(async() => await v4_3.GetRoutingTable(null, "adb", null));

            ex.Should().BeOfType <ProtocolException>().Which
            .Message.Should()
            .Contain("Attempting to get a routing table on a null connection");
        }
        public async Task RoutingTableShouldContainDatabaseName()
        {
            var databaseName = "myDatabaseName";
            var protocol     = new BoltProtocolV4_3(new Dictionary <string, string> {
                { "ContextKey", "ContextValue" }
            });
            var connection = SetupMockedConnection(databaseName);

            var routingTable = await protocol.GetRoutingTable(connection, databaseName, null, null);

            routingTable.ToDictionary().Should().ContainKey("db").WhichValue.Should().Be(databaseName);
        }