initial commit
[CPE_learningsite] / CPE / CPE.App / CPE.App.Notify.Test / StopSessionTest.cs
1 /*
2 Developer: Tyler Allen
3 Date Created: 08/24/2016
4 ---------------------------------------------------
5 */
6
7 using CPE.App.Notify.Helpers;
8 using CPE.App.Notify.Models.Enums;
9 using Microsoft.VisualStudio.TestTools.UnitTesting;
10 using Shouldly;
11
12 namespace CPE.App.NotifyConsole.Test {
13     [TestClass]
14     public class StopSessionTest {
15         /* 
16             Private test variables
17
18             These are database specific because it's easier and
19             probably more efective than to replicate service requests
20         */
21         private const int _brokenKey = 0;
22         private const int _meetingSessionKey = 10122;
23         private const long _workingMeetingRoomPrincipalId = 1056036046;
24         private const long _workingMeetingRoomScoId = 1196731724;
25         private const long _workingRecordingPrincipalId = 1196825657;
26         private const long _workingRecordingScoId = 1190521196;
27
28         #region Meeting Sessions
29
30         [TestMethod]
31         public void session_found() {
32             var meetingSession = SessionHelper.getMeetingSession(_meetingSessionKey);
33             meetingSession.ShouldNotBeNull();
34         }
35
36         [TestMethod]
37         public void session_not_found() {
38             var meetingSession = SessionHelper.getMeetingSession(_brokenKey);
39             meetingSession.ShouldBeNull();
40         }
41
42         #endregion
43
44         #region Meeting Participant Sessions
45
46         [TestMethod]
47         public void meeting_participant_sessions_found() {
48             var meetingParticipantSessions = SessionHelper.getMeetingParticipantSessions(_meetingSessionKey);
49             meetingParticipantSessions.ShouldNotBeNull();
50             meetingParticipantSessions.Count.ShouldBeGreaterThan(0);
51         }
52
53         [TestMethod]
54         public void meeting_participant_sessions_not_found() {
55             var meetingParticipantSessions = SessionHelper.getMeetingParticipantSessions(_brokenKey);
56             meetingParticipantSessions.ShouldNotBeNull();
57             meetingParticipantSessions.Count.ShouldBe(0);
58         }
59
60         #endregion
61
62         #region Participant Purchase
63
64         [TestMethod]
65         public void participant_purchase_participantkey_found() {
66             var participantPurchase = SessionHelper.getParticipantPurchase(_workingRecordingPrincipalId, _workingRecordingScoId);
67             participantPurchase.ShouldNotBeNull();
68         }
69
70         [TestMethod]
71         public void participant_purchase_participantkey_not_found() {
72             var participantPurchase = SessionHelper.getParticipantPurchase(_brokenKey, (long) _brokenKey);
73             participantPurchase.ShouldBeNull();
74         }
75
76         #endregion
77
78         #region Stop Session
79
80         [TestMethod]
81         public void stop_session_working() {
82             var boolResult = SessionHelper.StopSession(_meetingSessionKey, true);
83             boolResult.ShouldBeTrue();
84         }
85
86         #endregion
87     }
88 }