コード例 #1
0
        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));
        }
コード例 #2
0
        public void GetUrl(string facebookId, string expectedUrl)
        {
            // Act
            var url = FacebookUrlBuilder.GetUrl(facebookId);

            // Assert
            url.Should().Be(expectedUrl);
        }
コード例 #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))));
        }