public void TryParse_ValidDsn_Succeeds() { var @case = new DsnTestCase(); Assert.True(Dsn.TryParse(@case, out var dsn)); AssertEqual(@case, dsn); }
public void Ctor_MissingSecretKey_GetterReturnsNull() { var @case = new DsnTestCase { SecretKey = null }; var sut = new Dsn(@case); Assert.Null(sut.SecretKey); }
public void TryParse_EmptyPath_Succeeds() { var @case = new DsnTestCase { Path = string.Empty }; Assert.True(Dsn.TryParse(@case, out var dsn)); AssertEqual(@case, dsn); }
public void TryParse_FutureScheme_Succeeds() { var @case = new DsnTestCase { Scheme = "hypothetical" }; Assert.True(Dsn.TryParse(@case, out var dsn)); AssertEqual(@case, dsn); }
public void Ctor_FutureScheme_ValidDsn() { var @case = new DsnTestCase { Scheme = "hypothetical" }; var dsn = new Dsn(@case); AssertEqual(@case, dsn); }
public void TryParse_InvalidHost_Fails() { var @case = new DsnTestCase { Host = null }; Assert.False(Dsn.TryParse(@case, out var dsn)); Assert.Null(dsn); }
public void Ctor_MissingScheme_ThrowsUriFormatException() { var @case = new DsnTestCase { Scheme = null }; var ex = Assert.Throws <UriFormatException>(() => new Dsn(@case)); Assert.Equal("Invalid URI: The format of the URI could not be determined.", ex.Message); }
public void TryParse_MissingProjectId_Fails() { var @case = new DsnTestCase { ProjectId = null }; Assert.False(Dsn.TryParse(@case, out var dsn)); Assert.Null(dsn); }
public void TryParse_InvalidPort_Fails() { var @case = new DsnTestCase { Port = -1 }; Assert.False(Dsn.TryParse(@case, out var dsn)); Assert.Null(dsn); }
public void Ctor_MissingPublicKey_ThrowsArgumentException() { var @case = new DsnTestCase { PublicKey = null }; var ex = Assert.Throws <ArgumentException>(() => new Dsn(@case)); Assert.Equal("Invalid DSN: No public key provided.", ex.Message); }
public void TryParse_MissingPublicAndSecretKey_Fails() { var @case = new DsnTestCase { PublicKey = null, SecretKey = null, UserInfoSeparator = null, CredentialSeparator = null }; Assert.False(Dsn.TryParse(@case, out var dsn)); Assert.Null(dsn); }
public void TryParse_ValidDsn_Succeeds() { var @case = new DsnTestCase(); var dsn = Dsn.TryParse(@case); Assert.NotNull(dsn); AssertEqual(@case, dsn); }
public void Ctor_InvalidHost_ThrowsUriFormatException() { var @case = new DsnTestCase { Host = null }; var ex = Assert.Throws <UriFormatException>(() => new Dsn(@case)); Assert.Equal("Invalid URI: The hostname could not be parsed.", ex.Message); }
public void TryParse_MissingScheme_Fails() { var @case = new DsnTestCase { Scheme = null }; Assert.False(Dsn.TryParse(@case, out var dsn)); Assert.Null(dsn); }
public void Ctor_InvalidPort_ThrowsUriFormatException() { var @case = new DsnTestCase { Port = -1 }; var ex = Assert.Throws <UriFormatException>(() => new Dsn(@case)); Assert.Equal("Invalid URI: Invalid port specified.", ex.Message); }
public void Ctor_MissingProjectId_ThrowsArgumentException() { var @case = new DsnTestCase { ProjectId = null }; var ex = Assert.Throws <ArgumentException>(() => new Dsn(@case)); Assert.Equal("Invalid DSN: A Project Id is required.", ex.Message); }
public void Ctor_MissingPublicAndSecretKey_ThrowsArgumentException() { var @case = new DsnTestCase { PublicKey = null, SecretKey = null, UserInfoSeparator = null, CredentialSeparator = null }; var ex = Assert.Throws <ArgumentException>(() => new Dsn(@case)); Assert.Equal("Invalid DSN: No public key provided.", ex.Message); }
public void Ctor_EmptyPath_ValidDsn() { var @case = new DsnTestCase { Path = string.Empty }; var dsn = new Dsn(@case); AssertEqual(@case, dsn); }
public void TryParse_MissingSecretKey_Succeeds() { var @case = new DsnTestCase { SecretKey = null }; Assert.True(Dsn.TryParse(@case, out var dsn)); AssertEqual(@case, dsn); }
public void TryParse_EmptyPath_Succeeds() { var @case = new DsnTestCase { Path = string.Empty }; var dsn = Dsn.TryParse(@case); Assert.NotNull(dsn); AssertEqual(@case, dsn); }
public void TryParse_FutureScheme_Succeeds() { var @case = new DsnTestCase { Scheme = "hypothetical" }; var dsn = Dsn.TryParse(@case); Assert.NotNull(dsn); AssertEqual(@case, dsn); }
public void TryParse_MissingSecretKey_Succeeds() { var @case = new DsnTestCase { SecretKey = null }; var dsn = Dsn.TryParse(@case); Assert.NotNull(dsn); AssertEqual(@case, dsn); }