Git Repository Public Repository

CPE_learningsite

URLs

Copy to Clipboard

This repository has no backups
This repository's network speed is throttled to 100KB/sec

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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
Developer: Tyler Allen
Date Created: 08/24/2016
---------------------------------------------------
*/

using CPE.App.Notify.Helpers;
using CPE.App.Notify.Models.Enums;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Shouldly;

namespace CPE.App.NotifyConsole.Test {
    [TestClass]
    public class StopSessionTest {
        /* 
            Private test variables

            These are database specific because it's easier and
            probably more efective than to replicate service requests
        */
        private const int _brokenKey = 0;
        private const int _meetingSessionKey = 10122;
        private const long _workingMeetingRoomPrincipalId = 1056036046;
        private const long _workingMeetingRoomScoId = 1196731724;
        private const long _workingRecordingPrincipalId = 1196825657;
        private const long _workingRecordingScoId = 1190521196;

        #region Meeting Sessions

        [TestMethod]
        public void session_found() {
            var meetingSession = SessionHelper.getMeetingSession(_meetingSessionKey);
            meetingSession.ShouldNotBeNull();
        }

        [TestMethod]
        public void session_not_found() {
            var meetingSession = SessionHelper.getMeetingSession(_brokenKey);
            meetingSession.ShouldBeNull();
        }

        #endregion

        #region Meeting Participant Sessions

        [TestMethod]
        public void meeting_participant_sessions_found() {
            var meetingParticipantSessions = SessionHelper.getMeetingParticipantSessions(_meetingSessionKey);
            meetingParticipantSessions.ShouldNotBeNull();
            meetingParticipantSessions.Count.ShouldBeGreaterThan(0);
        }

        [TestMethod]
        public void meeting_participant_sessions_not_found() {
            var meetingParticipantSessions = SessionHelper.getMeetingParticipantSessions(_brokenKey);
            meetingParticipantSessions.ShouldNotBeNull();
            meetingParticipantSessions.Count.ShouldBe(0);
        }

        #endregion

        #region Participant Purchase

        [TestMethod]
        public void participant_purchase_participantkey_found() {
            var participantPurchase = SessionHelper.getParticipantPurchase(_workingRecordingPrincipalId, _workingRecordingScoId);
            participantPurchase.ShouldNotBeNull();
        }

        [TestMethod]
        public void participant_purchase_participantkey_not_found() {
            var participantPurchase = SessionHelper.getParticipantPurchase(_brokenKey, (long) _brokenKey);
            participantPurchase.ShouldBeNull();
        }

        #endregion

        #region Stop Session

        [TestMethod]
        public void stop_session_working() {
            var boolResult = SessionHelper.StopSession(_meetingSessionKey, true);
            boolResult.ShouldBeTrue();
        }

        #endregion
    }
}

Commits for CPE_learningsite/CPE/CPE.App/CPE.App.Notify.Test/StopSessionTest.cs

Diff revisions: vs.
Revision Author Commited Message
4cd176 ... v.shishlov Fri 27 Aug, 2021 14:33:17 +0000

initial commit