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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
Developer: Tyler Allen
Date Created: 08/24/2016
---------------------------------------------------
*/

using System.Linq;
using CPE.App.Notify.Helpers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Shouldly;

namespace CPE.App.NotifyConsole.Test {
    [TestClass]
    public class ArchiveSessionTest {
        /* 
            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 = 10449;
        private const int _workingMeetingParticipantSessionKey = 37171;
        private const long _workingMeetingRoomPrincipalId = 1056036046;
        private const long _workingMeetingRoomScoId = 1196731724;
        private const long _workingRecordingPrincipalId = 1196825657;
        private const long _workingRecordingScoId = 1190521196;

        #region Meeting Participant Session

        [TestMethod]
        public void meeting_participant_session_found() {
            var meetingParticipantSession = SessionHelper.getMeetingParticipantSession(_workingMeetingParticipantSessionKey);
            meetingParticipantSession.ShouldNotBeNull();
        }

        // TODO: Create a working test for session found
        // This is not a valid test
        // Not sure how to test
        [TestMethod]
        public void meeting_participant_meeting_session_found() {
            var meetingParticipantSession = SessionHelper.getMeetingParticipantSession(_workingMeetingParticipantSessionKey, _workingMeetingRoomPrincipalId);
            meetingParticipantSession.ShouldBeNull();
        }

        [TestMethod]
        public void meeting_participant_session_not_found() {
            var meetingParticipantSession = SessionHelper.getMeetingParticipantSession(_brokenKey);
            meetingParticipantSession.ShouldBeNull();
        }

        [TestMethod]
        public void meeting_participant_meeting_session_not_found() {
            var meetingParticipantSession = SessionHelper.getMeetingParticipantSession(_workingMeetingParticipantSessionKey, _workingMeetingRoomPrincipalId);
            meetingParticipantSession.ShouldBeNull();
        }

        #endregion

        #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 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 Archive Session

        [TestMethod]
        public void archive_session_working()
        {
            var boolResult = SessionHelper.ArchiveSession(_workingMeetingParticipantSessionKey, true);
            boolResult.ShouldBeTrue();
        }

        [TestMethod]
        public void archive_session_by_meeting_session_working() {
            var sessions = SessionHelper.getRecordingCandidates(_meetingSessionKey);
            sessions.ShouldNotBeNull();
            sessions.Count().ShouldBeGreaterThan(0);
            var boolResult = SessionHelper.ArchiveSessionByMeetingSession(_meetingSessionKey, true);
            boolResult.ShouldBeTrue();
        }

        [TestMethod]
        public void archive_session_get_candidates_not_found()
        {
            var sessions = SessionHelper.getRecordingCandidates(_brokenKey);
            sessions.ShouldNotBeNull();
            sessions.Count().ShouldBe(0);
        }

        #endregion
    }
}

Commits for CPE_learningsiteCPE/CPE.App/CPE.App.Notify.Test/ArchiveSessionTest.cs

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

initial commit