public void TestSearchBatchMailingsInvalidSearch() { IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy(); IServiceCommunicator serviceCommunicator = MockServiceCommunicator(); IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient(_url, _username, _password, serviceCommunicator, basicAuthStrategy); Assert.Throws <ArgumentException>(() => stamprApiClient.GetBatchMailings(1930, new SearchModel <StamprApiClient.Api.Models.Mailing.Status>())); }
public void TestSearchBatchMailingsSuccessful() { IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy(); IServiceCommunicator serviceCommunicator = MockServiceCommunicator(); IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient(_url, _username, _password, serviceCommunicator, basicAuthStrategy); var mailings = stamprApiClient.GetBatchMailings(1930, StamprApiClient.Api.Models.Mailing.Status.queued, DateTime.Parse("2013-05-24T18:01:35.707Z"), DateTime.Parse("2013-05-25T18:01:35.707Z"), 12).First(); Assert.AreEqual(mailings.Format, StamprApiClient.Api.Models.Mailing.Format.none); Assert.AreEqual(mailings.Address, "Add"); Assert.AreEqual(mailings.ReturnAddress, "RetAdd"); Assert.AreEqual(mailings.Mailing_Id, 1348); Assert.AreEqual(mailings.User_Id, 1); }
public void TestSearchBatchMailingsInvalidSearch() { IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy(); IServiceCommunicator serviceCommunicator = MockServiceCommunicator(); IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient(_url, _username, _password, serviceCommunicator, basicAuthStrategy); Assert.Throws<ArgumentException>(() => stamprApiClient.GetBatchMailings(1930, new SearchModel<StamprApiClient.Api.Models.Mailing.Status>())); }