public void Should_map_all_properties() { Builder <Participant> .CreateNew().With(x => x.Role = UserRole.Individual).Build(); var participants = new List <Participant> { Builder <Participant> .CreateNew().With(x => x.Role = UserRole.Individual).Build(), Builder <Participant> .CreateNew().With(x => x.Role = UserRole.Representative).Build(), Builder <Participant> .CreateNew().With(x => x.Role = UserRole.Judge).Build() }; var conference = Builder <Conference> .CreateNew() .With(x => x.Id = Guid.NewGuid()) .With(x => x.Participants = participants) .With(x => x.Number_of_endpoints = 2) .Build(); var response = ConferenceForJudgeResponseMapper.MapConferenceSummaryToModel(conference); response.Id.Should().Be(conference.Id); response.ScheduledDateTime.Should().Be(conference.Scheduled_date_time); response.ScheduledDuration.Should().Be(conference.Scheduled_duration); response.CaseType.Should().Be(conference.Case_type); response.CaseNumber.Should().Be(conference.Case_number); response.CaseName.Should().Be(conference.Case_name); response.Status.ToString().Should().Be(conference.Status.ToString()); response.Participants.Count.Should().Be(participants.Count); response.NumberOfEndpoints.Should().Be(conference.Number_of_endpoints); }
public void should_map_number_of_endpoints_to_zero() { var conference = new ConferenceBuilder() .WithConferenceStatus(ConferenceState.InSession) .WithParticipant(UserRole.Judge, "Judge") .WithParticipants(1) .Build(); var response = ConferenceForJudgeResponseMapper.MapConferenceSummaryToModel(conference); response.Id.Should().Be(conference.Id); response.NumberOfEndpoints.Should().Be(0); }
public void should_map_all_properties() { var conference = new ConferenceBuilder() .WithConferenceStatus(ConferenceState.InSession) .WithConferenceStatus(ConferenceState.Paused) .WithConferenceStatus(ConferenceState.Closed) .WithParticipant(UserRole.Judge, "Judge") .WithParticipants(3) .WithEndpoint("3000", "sip address") .Build(); var response = ConferenceForJudgeResponseMapper.MapConferenceSummaryToModel(conference); response.Id.Should().Be(conference.Id); response.ScheduledDateTime.Should().Be(conference.ScheduledDateTime); response.ScheduledDuration.Should().Be(conference.ScheduledDuration); response.CaseType.Should().Be(conference.CaseType); response.CaseName.Should().Be(conference.CaseName); response.CaseNumber.Should().Be(conference.CaseNumber); response.Status.ToString().Should().Be(conference.State.ToString()); response.Participants.Count.Should().Be(conference.Participants.Count); response.NumberOfEndpoints.Should().Be(conference.Endpoints.Count); }
public void Setup() { _mocker = AutoMock.GetLoose(); _mocker.Mock <IMapperFactory>().Setup(x => x.Get <Participant, VideoWeb.Contract.Responses.ParticipantForJudgeResponse>()).Returns(_mocker.Create <ParticipantForJudgeResponseMapper>()); _sut = _mocker.Create <ConferenceForJudgeResponseMapper>(); }