/* 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 } }