aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.UnitTesting
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2019-02-19 01:50:58 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2019-02-19 01:50:58 +0200
commit9736b8c8ede6a0d121dea8381f0abb561fad5631 (patch)
tree1c38f3f5be82b923ffae40fae00a25487179ab54 /Software/Visual_Studio/Tango.UnitTesting
parentbe3343cc0268179c7a6f628fa5e68f323a3335e5 (diff)
downloadTango-9736b8c8ede6a0d121dea8381f0abb561fad5631.tar.gz
Tango-9736b8c8ede6a0d121dea8381f0abb561fad5631.zip
Implemented auto generated web clients for PPC and machine studio.
Improved interactions with web clients across solutions.
Diffstat (limited to 'Software/Visual_Studio/Tango.UnitTesting')
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs
index ca1653e3e..ababd1793 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs
+++ b/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs
@@ -1,6 +1,7 @@
using System;
using System.Threading;
using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Tango.Transport.Web;
using Tango.Web.Authentication;
namespace Tango.UnitTesting
@@ -30,8 +31,8 @@ namespace Tango.UnitTesting
TokenObject t2 = new TokenObject();
t2.Value = "Sagi";
- String token1 = tokensManager.GetOrCreate(t1);
- String token2 = tokensManager.GetOrCreate(t2);
+ String token1 = tokensManager.GetOrCreate(t1).AccessToken;
+ String token2 = tokensManager.GetOrCreate(t2).AccessToken;
Assert.AreEqual(tokensManager.GetTokenObject(token1), t1);
Assert.AreEqual(tokensManager.GetTokenObject(token2), t2);
@@ -39,7 +40,7 @@ namespace Tango.UnitTesting
TokenObject t3 = new TokenObject();
t3.Value = "Roy";
- String token3 = tokensManager.GetOrCreate(t3);
+ String token3 = tokensManager.GetOrCreate(t3).AccessToken;
Assert.AreEqual(token3, token1);
Assert.AreEqual(tokensManager.GetTokenObject(token1), tokensManager.GetTokenObject(token3));
@@ -52,13 +53,13 @@ namespace Tango.UnitTesting
Thread.Sleep(2000);
- String recent_token = tokensManager.GetOrCreate(tOld);
+ String recent_token = tokensManager.GetOrCreate(tOld).AccessToken;
Thread.Sleep(1000);
- Assert.IsTrue(tokensManager.Exists(recent_token));
+ tokensManager.Validate(recent_token);
- Assert.IsFalse(tokensManager.Exists(token1));
+ Assert.ThrowsException<SessionExpiredException>(() => tokensManager.Validate(token1));
}
}
}