public void DefaultDIConstructor() { // Arrange Uri uri = new Uri("http://tempuri.org"); EsendexCredentials credentials = new EsendexCredentials("username", "password"); IHttpRequestHelper httpRequestHelper = new HttpRequestHelper(); IHttpResponseHelper httpResponseHelper = new HttpResponseHelper(); IHttpClient httpClient = new HttpClient(credentials, uri, httpRequestHelper, httpResponseHelper); // Act RestClient restClientInstance = new RestClient(httpClient); // Assert Assert.That(restClientInstance.HttpClient, Is.InstanceOf<HttpClient>()); }
public void DefaultDIConstructor() { // Arrange Uri uri = new Uri("http://tempuri.org"); EsendexCredentials credentials = new EsendexCredentials("username", "password"); IHttpRequestHelper httpRequestHelper = new HttpRequestHelper(); IHttpResponseHelper httpResponseHelper = new HttpResponseHelper(); IHttpClient httpClient = new HttpClient(credentials, uri, httpRequestHelper, httpResponseHelper); IRestClient restClient = new RestClient(httpClient); ISerialiser serialiser = new XmlSerialiser(); // Act SessionService serviceInstance = new SessionService(restClient, serialiser); // Assert Assert.That(serviceInstance.RestClient, Is.InstanceOf<RestClient>()); Assert.That(serviceInstance.Serialiser, Is.InstanceOf<XmlSerialiser>()); }
public void DefaultDIConstructor() { // Arrange var uri = new Uri("http://tempuri.org"); var credentials = new EsendexCredentials("username", "password"); IHttpRequestHelper httpRequestHelper = new HttpRequestHelper(); IHttpResponseHelper httpResponseHelper = new HttpResponseHelper(); IHttpClient httpClient = new HttpClient(credentials, uri, httpRequestHelper, httpResponseHelper); IRestClient restClient = new RestClient(httpClient); ISerialiser serialiser = new XmlSerialiser(); // Act var serviceInstance = new MessagingService(restClient, serialiser, true); // Assert Assert.That(serviceInstance.RestClient, Is.InstanceOf<RestClient>()); Assert.That(serviceInstance.Serialiser, Is.InstanceOf<XmlSerialiser>()); Assert.IsTrue(serviceInstance.EnsureMessageIdsInResult); }