Beispiel #1
0
        public void FormsDeleteExistingFormUrlFormedCorrectly()
        {
            var mockDataSource = MockRepository.GenerateMock <IWebClient>();
            var expectedUrl    = Constants.DeleteExistingFormUrl;

            // Arrange
            mockDataSource
            .Stub(x => x.UploadString(
                      Arg <string> .Is.Anything, // uri
                      Arg <string> .Is.Anything, // method
                      Arg <string> .Is.Anything, // content-type
                      Arg <string> .Is.Anything  // data
                      ))
            .Return(string.Empty);

            // Act
            var target = new Forms(apiKey: Constants.ApiKey)
            {
                UserWebClient = mockDataSource
            };

            target.DeleteExistingForm("b409d881-7bc3-4d8b-ad7a-cebe188f27b0");

            // Assert
            mockDataSource.AssertWasCalled(c => c.UploadString(
                                               uri: Arg <string> .Matches(actualUrl => actualUrl == expectedUrl),
                                               method: Arg <string> .Is.Anything,
                                               contentType: Arg <string> .Is.Anything,
                                               data: Arg <string> .Is.Anything));
        }