09-08-2023

This commit is contained in:
Jonathan Jenne
2023-08-09 09:10:03 +02:00
parent c7f4885078
commit 3e41e5b469
44 changed files with 1024 additions and 638 deletions

View File

@@ -0,0 +1,41 @@
Imports Microsoft.VisualStudio.TestTools.UnitTesting
Imports Newtonsoft.Json
Imports Connectors.Form.slt.Responses
Namespace Connectors.Test
<TestClass>
Public Class AuthTest
ReadOnly oAvailableSystemsResponse As String = "{""Message"":null,""State"":true,""Type"":40,""Value"":[{""Deactivated"":false,""Description"":"""",""Priority"":1,""SystemID"":""764f0168-0005-43ca-bfe7-267b5fe254f4"",""SystemName"":""Prod: e.wa riss Netze GmbH""}]}"
ReadOnly oLoginResponse As String = "{""Message"":null,""State"":true,""Type"":40,""Value"":""18487109-f789-4094-9f18-4f0ce85461ca""}"
ReadOnly oLogoutResponse As String = "{""Message"": null,""State"":true,""Type"":40}"
<TestMethod>
Sub AvailableSystemsTest()
Dim oResp As sltAvailableSystemResponse = JsonConvert.DeserializeObject(Of sltAvailableSystemResponse)(oAvailableSystemsResponse)
Assert.AreEqual(True, oResp.State)
Assert.AreEqual(40, oResp.Type)
Assert.AreEqual(1, oResp.Value.Count)
End Sub
<TestMethod>
Sub LoginTest()
Dim oResp As sltLoginResponse = JsonConvert.DeserializeObject(Of sltLoginResponse)(oLoginResponse)
Assert.AreEqual(Nothing, oResp.Message)
Assert.AreEqual(True, oResp.State)
Assert.AreEqual(40, oResp.Type)
Assert.AreEqual("18487109-f789-4094-9f18-4f0ce85461ca", oResp.Value)
End Sub
<TestMethod>
Sub Logout()
Dim oResp As sltLogoutResponse = JsonConvert.DeserializeObject(Of sltLogoutResponse)(oLogoutResponse)
Assert.AreEqual(Nothing, oResp.Message)
Assert.AreEqual(True, oResp.State)
Assert.AreEqual(40, oResp.Type)
End Sub
End Class
End Namespace