mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-07-22 17:25:54 +02:00
Tests: LoginTests: Add test
This commit is contained in:
parent
989b051527
commit
d62c5913ec
1 changed files with 20 additions and 0 deletions
|
@ -45,6 +45,26 @@ namespace SMBLibrary.Tests.IntegrationTests
|
|||
Assert.AreEqual(NTStatus.STATUS_SUCCESS, status);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void When_ClientDisconnectAndReconnect_LoginSucceed()
|
||||
{
|
||||
// Arrange
|
||||
SMB2Client client = new SMB2Client();
|
||||
client.Connect(IPAddress.Loopback, SMBTransportType.DirectTCPTransport, m_serverPort, 5000);
|
||||
|
||||
// Act
|
||||
NTStatus status = client.Login("", "John", "password");
|
||||
Assert.AreEqual(NTStatus.STATUS_SUCCESS, status);
|
||||
status = client.Logoff();
|
||||
Assert.AreEqual(NTStatus.STATUS_SUCCESS, status);
|
||||
client.Disconnect();
|
||||
client.Connect(IPAddress.Loopback, SMBTransportType.DirectTCPTransport, m_serverPort, 5000);
|
||||
status = client.Login("", "John", "password");
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(NTStatus.STATUS_SUCCESS, status);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void When_InvalidCredentialsProvided_LoginFails()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue