Beispiel #1
0
 public MeetingTest()
 {
     _onlineMeetinginfo = new OnlineMeetingInfo()
     {
         JoinUrl = SharedSettings.EncodedMeetingUrlSample
     };
 }
Beispiel #2
0
        public Meeting(Attendee[] attendees, OnlineMeetingInfo meetingInfo)
        {
            AttendeeEmails = this.GetAttendeeEmails(attendees);

            string meetingUrl = meetingInfo.JoinUrl;

            if (String.IsNullOrEmpty(meetingUrl))
            {
                IsOnlineMeetingSet = false;
            }
            else
            {
                MeetingUrl         = meetingUrl;
                IsOnlineMeetingSet = true;
                this.ExtractAndSetOnlineMeetingInfo(meetingUrl);
            }
        }
Beispiel #3
0
        public async void GetOnlineMeeting_NoAttendeeMeeting_ThrowsArgumentException()
        {
            // Arrange
            var eventWithAttendee = new Event();
            var onlineMeetingInfo = new OnlineMeetingInfo()
            {
                JoinUrl = SharedSettings.EncodedMeetingUrlSample
            };

            eventWithAttendee.OnlineMeeting = onlineMeetingInfo;

            var graphClientMock = new Mock <IGraphServiceClient>();

            graphClientMock.Setup(gc => gc.Users[It.IsAny <string>()].Calendar.Events[It.IsAny <string>()].Request(It.IsAny <List <HeaderOption> >()).GetAsync())
            .ReturnsAsync(eventWithAttendee);
            var meetingService = new MeetingService(graphClientMock.Object);

            // Act & Assert
            await Assert.ThrowsAsync <ArgumentException>(async() => await meetingService.GetOnlineMeetingInfo("meetingId", "userId", "accessToken"));
        }
Beispiel #4
0
        public async void GetOnlineMeeting_expectedInput_ReturnMsGraphEvent()
        {
            // Arrange
            var eventWithAttendee = new Event();
            var attendees         = new Attendee[] {
                new Attendee()
                {
                    EmailAddress = new EmailAddress()
                    {
                        Address = "*****@*****.**"
                    }
                }
            };

            eventWithAttendee.Attendees = attendees;
            var onlineMeetingInfo = new OnlineMeetingInfo()
            {
                JoinUrl = SharedSettings.EncodedMeetingUrlSample
            };

            eventWithAttendee.OnlineMeeting = onlineMeetingInfo;

            var graphClientMock = new Mock <IGraphServiceClient>();

            graphClientMock.Setup(gc => gc.Users[It.IsAny <string>()].Calendar.Events[It.IsAny <string>()].Request(It.IsAny <List <HeaderOption> >()).GetAsync())
            .ReturnsAsync(eventWithAttendee);
            var meetingService = new MeetingService(graphClientMock.Object);

            var expected = new Meeting(attendees, onlineMeetingInfo);

            // Act
            var result = await meetingService.GetOnlineMeetingInfo("meetingId", "userId", "accessToken");

            // Assert
            result.Should().BeEquivalentTo(expected);
        }