diff --git a/Snowflake.Data.Tests/UnitTests/SFSessionPropertyTest.cs b/Snowflake.Data.Tests/UnitTests/SFSessionPropertyTest.cs index a254f8a82..bef1093a8 100644 --- a/Snowflake.Data.Tests/UnitTests/SFSessionPropertyTest.cs +++ b/Snowflake.Data.Tests/UnitTests/SFSessionPropertyTest.cs @@ -43,6 +43,20 @@ public void TestThatItFailsForWrongConnectionParameter(string connectionString, Assert.AreEqual(SFError.INVALID_CONNECTION_PARAMETER_VALUE.GetAttribute().errorCode, exception.ErrorCode); Assert.IsTrue(exception.Message.Contains(expectedErrorMessagePart)); } + + [Test] + [TestCase("ACCOUNT=;USER=testuser;PASSWORD=testpassword")] + [TestCase("USER=testuser;PASSWORD=testpassword")] + public void TestThatItFailsIfNoAccountSpecified(string connectionString) + { + // act + var exception = Assert.Throws( + () => SFSessionProperties.parseConnectionString("ACCOUNT=;USER=testuser;PASSWORD=testpassword", null) + ); + + // assert + Assert.AreEqual(SFError.MISSING_CONNECTION_PROPERTY.GetAttribute().errorCode, exception.ErrorCode); + } public static IEnumerable ConnectionStringTestCases() {