Пример #1
0
        public async Task ItPassesTheEmailsToTheNotifyApi(string email)
        {
            OneTimeLinkNotification notification = new OneTimeLinkNotification
            {
                Email = email,
                Url   = "stub",
                Token = "stub"
            };

            await _classUnderTest.SendOneTimeLinkAsync(notification, CancellationToken.None);

            NotifyRequest notifyRequest = _simulator.ReceivedRequests[0].BodyAs <NotifyRequest>();

            notifyRequest.email_address.Should().Be(email);
        }
Пример #2
0
        public async Task ItPassesTheAccessUrlToTheNotifyApi(string assetRegisterUrl, string token)
        {
            OneTimeLinkNotification notification = new OneTimeLinkNotification
            {
                Email = "*****@*****.**",
                Url   = assetRegisterUrl,
                Token = token
            };

            await _classUnderTest.SendOneTimeLinkAsync(notification, CancellationToken.None);

            NotifyRequest notifyRequest = _simulator.ReceivedRequests[0].BodyAs <NotifyRequest>();

            var expectedUrl = $"{assetRegisterUrl}?token={token}";

            notifyRequest.personalisation.access_url.Should().Be(expectedUrl);
        }