Skip to content

Commit

Permalink
Merge pull request #2887 from fitzchak/master
Browse files Browse the repository at this point in the history
RDBQA-45 CanUseWindowsAuthentication test should use invalid user nam…
  • Loading branch information
Fitzchak Yitzchaki committed Nov 19, 2015
2 parents ac63959 + 1d5a0b1 commit 9a43b01
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
Expand Up @@ -10,11 +10,13 @@ public static class FactIfWindowsAuthenticationIsAvailable
private static bool triedLoading = false;

public static string Username { get; private set; }

public static string Domain { get; private set; }

public static string Password { get; private set; }

public static string InvalidUsername { get; private set; }
public static string InvalidPassword { get; private set; }
public static string InvalidDomain { get; private set; }

public static void LoadCredentials()
{
if (Username != null)
Expand All @@ -39,6 +41,9 @@ private static void LoadDebugCredentials()
Username = "local_user_test";
Password = "local_user_test";
Domain = "local_machine_name_test";
InvalidUsername = "local_machine_invalid_user";
InvalidPassword = "local_machine_invalid_user";
InvalidDomain = "local_machine_name_test";

if (Username == "local_user_test")
{
Expand Down Expand Up @@ -70,6 +75,18 @@ private static void ActualLoad()
Username = username[0];
}
Password = lines[1];

username = lines[2].Split('\\');
if (username.Length > 1)
{
InvalidDomain = username[0];
InvalidUsername = username[1];
}
else
{
InvalidUsername = username[0];
}
InvalidPassword = lines[3];
}
}
}
2 changes: 1 addition & 1 deletion Raven.Tests.Core/Auth/Authentication.cs
Expand Up @@ -84,7 +84,7 @@ public void CanUseWindowsAuthentication()

using (var store = new DocumentStore
{
Credentials = new NetworkCredential(FactIfWindowsAuthenticationIsAvailable.Username + "-2", FactIfWindowsAuthenticationIsAvailable.Password, FactIfWindowsAuthenticationIsAvailable.Domain),
Credentials = new NetworkCredential(FactIfWindowsAuthenticationIsAvailable.InvalidUsername, FactIfWindowsAuthenticationIsAvailable.InvalidPassword, FactIfWindowsAuthenticationIsAvailable.InvalidDomain),
Url = this.Server.SystemDatabase.ServerUrl
}.Initialize())
{
Expand Down

0 comments on commit 9a43b01

Please sign in to comment.