Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b0d30963f1
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 36 lines (30 sloc) 1.138 kb
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
using System;
using System.Linq;
using Xunit;
using System.Configuration;

namespace FluentCassandra.Connections
{

public class NormalConnectionProviderTests
{
/// <summary>
/// Needed to switch to testing ports since the network timeout was making the tests unbearably long.
/// </summary>
        private readonly string _failoverConnectionString = "Keyspace=" + ConfigurationManager.AppSettings["TestKeySpace"] + ";Connection Timeout=1;Server=" + ConfigurationManager.AppSettings["TestServer"] + ":" + ConfigurationManager.AppSettings["TestPort"] + "";

[Fact]
public void Fails_Over()
{
// arrange
var expectedHost = ConfigurationManager.AppSettings["TestServer"];
var expectedPort = Convert.ToInt16(ConfigurationManager.AppSettings["TestPort"]);

            // act
var result = new ConnectionBuilder(_failoverConnectionString);
var provider = ConnectionProviderFactory.Get(result);
var conn = provider.Open();
var actualHost = conn.Server.Host;
var actualPort = conn.Server.Port;

// assert
Assert.Equal(expectedHost, actualHost);
Assert.Equal(expectedPort, actualPort);
}
}
}
Something went wrong with that request. Please try again.