I am working on a project where I am trying to test if a user has successfully logged in with valid credentials using the Microsoft.SharePoint.Client.dll.
Currently my code is checking the HTTP Response code for the SharePoint URL - however it is not checking to see if the user has passed in valid credentials.
For example - I can change my password, and the test will still pass since the code is only seeing if it is being passed a valid endpoint.
Is there a way with the Microsoft.SharePoint.Client.dll to see if a user has provided proper credentials?
Current Test
[TestMethod]
public void ConnectionToSharePoint_IsSuccessful()
{
var sharePointConnection = _sharePointService.OpenConnectionToSharePoint();
var webRequest = (HttpWebRequest) WebRequest
.Create(sharePointConnection.Url);
var responce = (HttpWebResponse) webRequest.GetResponse();
Assert.AreEqual(HttpStatusCode.OK,responce.StatusCode);
}