authentication.cs
778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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);
}
}
}