add ssl 1.2
[CPE_learningsite] / CPE / CPE.App / CPE.App.Api.Test / StatementControllerTest.cs
diff --git a/CPE/CPE.App/CPE.App.Api.Test/StatementControllerTest.cs b/CPE/CPE.App/CPE.App.Api.Test/StatementControllerTest.cs
new file mode 100644 (file)
index 0000000..26d04c8
--- /dev/null
@@ -0,0 +1,23 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+using CPE.App.Api.Helpers;
+using CPE.App.Api.Models;
+using Newtonsoft.Json;
+using Shouldly;
+
+namespace CPE.App.Api.Test
+{
+    [TestClass]
+    public class StatementControllerTest
+    {
+        [TestMethod]
+        public void HandleStatementTest()
+        {
+            var tincanObject =
+                "{\"id\":null,\"actor\":{\"name\":\"Patricia Berry\",\"mbox\":\"mailto:pberry@cpeincmail.com\"},\"verb\":{\"id\":\"http://adlnet.gov/expapi/verbs/passed\"},\"result\":{\"score\":{\"scaled\":1,\"raw\":0,\"min\":0,\"max\":0},\"success\":true,\"completion\":false},\"timestamp\":\"08/28/2021 16:38:19\",\"version\":null,\"object\":{\"id\":\"https://learning.elucidat.com/course/611ecf21dbbae-611fca09461e2\",\"definition\":{\"name\":{\"en-US\":\"Ethics for Hawaii CPAs  \"}}}}";
+            TinCanStatementModel statement = JsonConvert.DeserializeObject<TinCanStatementModel>(tincanObject);
+            var done = TinCanHelper.HandleStatement(statement);
+            done.ShouldBe(true);
+        }
+    }
+}