Exemple #1
0
        public void ResendVerification()
        {
            // Arrange
            var identityId = 1;

            var mockHttp = new MockHttpMessageHandler();

            mockHttp.Expect(HttpMethod.Post, Utils.GetSendGridApiUri(ENDPOINT, identityId, "resend_verification")).Respond(HttpStatusCode.NoContent);

            var client           = Utils.GetFluentClient(mockHttp);
            var senderIdentities = new SenderIdentities(client);

            // Act
            senderIdentities.ResendVerification(identityId, CancellationToken.None).Wait(CancellationToken.None);

            // Assert
            mockHttp.VerifyNoOutstandingExpectation();
            mockHttp.VerifyNoOutstandingRequest();
        }
Exemple #2
0
        public void ResendVerification()
        {
            // Arrange
            var identityId = 1;

            var mockRepository = new MockRepository(MockBehavior.Strict);
            var mockClient     = mockRepository.Create <IClient>();

            mockClient
            .Setup(c => c.PostAsync($"{ENDPOINT}/{identityId}/resend_verification", (JObject)null, It.IsAny <CancellationToken>()))
            .ReturnsAsync(new HttpResponseMessage(HttpStatusCode.NoContent))
            .Verifiable();

            var senderIdentities = new SenderIdentities(mockClient.Object, ENDPOINT);

            // Act
            senderIdentities.ResendVerification(identityId, CancellationToken.None).Wait(CancellationToken.None);

            // Assert
        }