public void TestPostConfigUnsuccessful() { IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy(); IServiceCommunicator serviceCommunicator = MockServiceCommunicator(); IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient("http://no", _username, _password, serviceCommunicator, basicAuthStrategy); Assert.Throws <ServiceCommunicationException>(() => stamprApiClient.CreateConfig()); }
public void TestPostConfig() { IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy(); IServiceCommunicator serviceCommunicator = MockServiceCommunicator(); IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient(_url, _username, _password, serviceCommunicator, basicAuthStrategy); ConfigModel model = stamprApiClient.CreateConfig(); Assert.AreEqual(model.Output, Output.single); Assert.AreEqual(model.Style, Style.color); Assert.AreEqual(model.Turnaround, Turnaround.threeday); Assert.AreEqual(model.Size, Size.standard); Assert.AreEqual(model.ReturnEnvelope, false); Assert.Greater(model.Config_Id, 0); Assert.Greater(model.User_Id, 0); }
public void TestPostConfigUnsuccessful() { IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy(); IServiceCommunicator serviceCommunicator = MockServiceCommunicator(); IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient("http://no", _username, _password, serviceCommunicator, basicAuthStrategy); Assert.Throws<ServiceCommunicationException>(() => stamprApiClient.CreateConfig()); }
public void TestPostConfig() { IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy(); IServiceCommunicator serviceCommunicator = MockServiceCommunicator(); IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient(_url, _username, _password, serviceCommunicator, basicAuthStrategy); ConfigModel model = stamprApiClient.CreateConfig(); Assert.AreEqual(model.Output, Output.single); Assert.AreEqual(model.Style, Style.color); Assert.AreEqual(model.Turnaround, Turnaround.threeday); Assert.AreEqual(model.Size, Size.standard); Assert.AreEqual(model.ReturnEnvelope, false); Assert.Greater(model.Config_Id, 0); Assert.Greater(model.User_Id, 0); }