public void Output([NotNull] GetUserProfileOutput interactorOutput)
        {
            if (interactorOutput == null)
            {
                throw new ArgumentNullException(nameof(interactorOutput));
            }

            viewModel = new MvcUserProfileViewModel(
                interactorOutput.AllowEdit,
                interactorOutput.UserId,
                interactorOutput.Roles,
                interactorOutput.Email,
                EmailUrlBuilder.GetUrl(interactorOutput.Email),
                interactorOutput.AvatarId,
                interactorOutput.Realname,
                interactorOutput.Firstname,
                interactorOutput.Lastname,
                interactorOutput.MemberSince.ToStringSwissDate(),
                interactorOutput.Slogan,
                interactorOutput.Education,
                interactorOutput.Experience,
                interactorOutput.MobilePhone,
                PhoneUrlBuilder.GetUrl(interactorOutput.MobilePhone),
                interactorOutput.WebsiteUrl,
                interactorOutput.TwitterHandle,
                TwitterUrlBuilder.GetUrl(interactorOutput.TwitterHandle),
                interactorOutput.FacebookId,
                FacebookUrlBuilder.GetUrl(interactorOutput.FacebookId),
                interactorOutput.SkypeId,
                SkypeUrlBuilder.GetUrl(interactorOutput.SkypeId));
        }
Beispiel #2
0
        public void GetUrl(string twitterHandle, string expectedUrl)
        {
            // Act
            var url = TwitterUrlBuilder.GetUrl(twitterHandle);

            // Assert
            url.Should().Be(expectedUrl);
        }
Beispiel #3
0
        public void Output([NotNull] MemberListOutput interactorOutput)
        {
            if (interactorOutput == null)
            {
                throw new ArgumentNullException(nameof(interactorOutput));
            }

            viewModel = new MvcMemberListViewModel(
                interactorOutput.AllowSeeDetails,
                interactorOutput.Members.Select(m => new MvcMemberListViewModel.MvcMemberViewModel(
                                                    m.DiverId,
                                                    m.Email,
                                                    m.AvatarId,
                                                    m.Name,
                                                    m.MemberSince.ToStringSwissDate(),
                                                    m.Education,
                                                    m.Experience,
                                                    m.Slogan,
                                                    m.WebsiteUrl,
                                                    m.TwitterHandle,
                                                    TwitterUrlBuilder.GetUrl(m.TwitterHandle),
                                                    m.FacebookId,
                                                    FacebookUrlBuilder.GetUrl(m.FacebookId))));
        }