Example #1
0
        public void ConstructorTest()
        {
            //Act
            var restClient = new SwiftRestClient(restClientMock.Object);

            //Assert
            Assert.IsNotNull(restClient);
        }
Example #2
0
        public void ServiceIntegrationTest()
        {
            //Arrange
            const string    hostName = "https://app.getswift.co/api/v2/deliveries"; //TODO: Add to configuration
            SwiftRestClient client   = new SwiftRestClient(new RestSharp.RestClient(hostName));

            //Act
            var results = client.Execute(hostName, new RestRequest());

            //Assert
            Assert.IsNotNull(results);
            Assert.AreEqual(results.StatusCode, HttpStatusCode.OK);
            Assert.AreNotEqual(results.Content, string.Empty);
        }
Example #3
0
 public void TestInitialize()
 {
     restClientMock = new Mock <IRestClient>(MockBehavior.Strict);
     restClientMock.Setup(rcm => rcm.AddHandler(contentTypes, It.IsAny <JsonDeserializer>()));
     testSubject = new SwiftRestClient(restClientMock.Object);
 }