This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
Incam_SGD/ktwebservice/nunit/authentication.cs

45 lines
778 B
C#

using NUnit.Framework;
using System;
using System.IO;
namespace MonoTests.KnowledgeTree
{
[TestFixture]
public class AuthenticationTest
{
private String _session;
private KnowledgeTreeService _kt;
[SetUp]
public void SetUp()
{
this._kt = new KTWebService();
}
[TearDown]
public void TearDown()
{
}
[Test]
public void Login()
{
kt_response response = this._kt.login("admin","admin","127.0.0.1");
Assert.AreEqual(0,response.status_code);
Assert.IsFalse(response.message == null);
Assert.IsFalse(response.message == "");
this._session = response.message;
}
[Test]
public void Logout()
{
kt_response response = this._kt.logout(this._session);
Assert.AreEqual(0,response.status_code);
}
}
}