public ActionResult <ShortenUrlResponseModel> Post([FromForm] ShortenUrlRequestModel request) { string ShortUrl = _shorteningService.Shorten(request.LongUrl, request.BaseUrl); ShortenUrlResponseModel model = new ShortenUrlResponseModel(); model.ShortenedUrl = ShortUrl; return(model); }
public NotificationPublisherServiceTestsFixture() { EmailMessageEventMock = new Mock <IRabbitPublisher <EmailMessageEvent> >(MockBehavior.Strict); SmsEventMock = new Mock <IRabbitPublisher <SmsEvent> >(MockBehavior.Strict); PushNotificationPublisher = new Mock <IRabbitPublisher <PushNotificationEvent> >(MockBehavior.Strict); CustomerProfileMock = new Mock <ICustomerProfileClient>(MockBehavior.Strict); UrlShortenerClientMock = new Mock <IUrlShortenerClient>(MockBehavior.Strict); EmailLinkFormat = "Link-{0}"; Service = new NotificationPublisherService( EmailMessageEventMock.Object, SmsEventMock.Object, PushNotificationPublisher.Object, CustomerProfileMock.Object, UrlShortenerClientMock.Object, EmailLinkFormat, string.Empty, string.Empty, EmailLinkFormat, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, true ); FirstName = "firstn"; LastName = "lastn"; PhoneNumber = "123123123"; CountryCode = "358"; Email = "email"; IsEmailVerified = true; CustomerProfileResponse = new CustomerProfileResponse { ErrorCode = CustomerProfileErrorCodes.None, Profile = new CustomerProfile.Client.Models.Responses.CustomerProfile { CustomerId = CustomerId.ToString(), Email = Email, FirstName = FirstName, LastName = LastName, IsEmailVerified = IsEmailVerified, PhoneNumber = PhoneNumber, Registered = DateTime.UtcNow } }; ReferralHotelProfileResponse = new ReferralHotelProfileResponse { ErrorCode = ReferralHotelProfileErrorCodes.None, Data = new ReferralHotelProfile { ReferralHotelId = Guid.Empty, Email = Email } }; ShortenUrlResponseModel = new ShortenUrlResponseModel { ShortenedUrl = EmailLinkFormat }; SetupCalls(); }