public void ShouldThrowOnNullInput() { Action action = () => ConnectionDetails.Parse(null); action .Should() .ThrowExactly <ArgumentNullException>(); }
public void ShouldThrowOnWhitespaceInput() { Action action = () => ConnectionDetails.Parse(" \t \r \n"); action .Should() .ThrowExactly <ArgumentException>(); }
public void ShouldThrowOnEmptyInput() { Action action = () => ConnectionDetails.Parse(string.Empty); action .Should() .ThrowExactly <ArgumentException>(); }
public void ShouldParsePostgresUrlStringWithoutPort() { var details = ConnectionDetails.Parse("postgres://*****:*****@localhost/somedatabase"); details .Should() .NotBeNull(); details.Database .Should() .Be("somedatabase"); details.User .Should() .Be("someuser"); details.Password .Should() .Be("somepassword"); details.Host .Should() .Be("localhost"); details.Port .Should() .Be(5432); }
public void ShouldParsePostgresUrlStringWithoutAuthInfo() { var details = ConnectionDetails.Parse("postgres://@somehost:381/somedatabase"); details .Should() .NotBeNull(); details.Database .Should() .Be("somedatabase"); details.User .Should() .BeEmpty(); details.Password .Should() .BeEmpty(); details.Host .Should() .Be("somehost"); details.Port .Should() .Be(381); }
public void ShouldParsePostgresUrlString() { var details = ConnectionDetails.Parse("postgres://*****:*****@somehost:381/somedatabase"); details .Should() .NotBeNull(); details.Database .Should() .Be("somedatabase"); details.User .Should() .Be("someuser"); details.Password .Should() .Be("somepassword"); details.Host .Should() .Be("somehost"); details.Port .Should() .Be(381); }