public void Ctor_MissingSecretKey_GetterReturnsNull() { var @case = new DsnTestCase { SecretKey = null }; var sut = Dsn.Parse(@case); Assert.Null(sut.SecretKey); }
public void Ctor_FutureScheme_ValidDsn() { var @case = new DsnTestCase { Scheme = "hypothetical" }; var dsn = Dsn.Parse(@case); AssertEqual(@case, dsn); }
public void Ctor_EmptyPath_ValidDsn() { var @case = new DsnTestCase { Path = string.Empty }; var dsn = Dsn.Parse(@case); AssertEqual(@case, dsn); }
public void TryParse_ValidDsn_Succeeds() { var @case = new DsnTestCase(); var dsn = Dsn.TryParse(@case); Assert.NotNull(dsn); AssertEqual(@case, dsn); }
public void Ctor_MissingScheme_ThrowsUriFormatException() { var @case = new DsnTestCase { Scheme = null }; var ex = Assert.Throws <UriFormatException>(() => Dsn.Parse(@case)); Assert.Equal("Invalid URI: The format of the URI could not be determined.", ex.Message); }
public void Ctor_InvalidHost_ThrowsUriFormatException() { var @case = new DsnTestCase { Host = null }; var ex = Assert.Throws <UriFormatException>(() => Dsn.Parse(@case)); Assert.Equal("Invalid URI: The hostname could not be parsed.", ex.Message); }
public void Ctor_InvalidPort_ThrowsUriFormatException() { var @case = new DsnTestCase { Port = -1 }; var ex = Assert.Throws <UriFormatException>(() => Dsn.Parse(@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>(() => Dsn.Parse(@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>(() => Dsn.Parse(@case)); Assert.Equal("Invalid DSN: No public key provided.", ex.Message); }
public void TryParse_MissingSecretKey_Succeeds() { var @case = new DsnTestCase { SecretKey = null }; var dsn = Dsn.TryParse(@case); Assert.NotNull(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); }