public void TestGetConfigAllUnsuccessful() { IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy(); IServiceCommunicator serviceCommunicator = MockServiceCommunicator(); IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient("http://no", _username, _password, serviceCommunicator, basicAuthStrategy); Assert.Throws<ServiceCommunicationException>(() => stamprApiClient.GetConfig(1)); }
public void TestGetConfigAllUnsuccessful() { IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy(); IServiceCommunicator serviceCommunicator = MockServiceCommunicator(); IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient("http://no", _username, _password, serviceCommunicator, basicAuthStrategy); Assert.Throws <ServiceCommunicationException>(() => stamprApiClient.GetConfig(1)); }
public void TestGetConfigSuccessful() { IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy(); IServiceCommunicator serviceCommunicator = MockServiceCommunicator(); IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient(_url, _username, _password, serviceCommunicator, basicAuthStrategy); ConfigModel model = stamprApiClient.GetConfig(4679).First(); 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.AreEqual(model.Config_Id, 4679); Assert.AreEqual(model.User_Id, 1); Assert.AreEqual(model.Version, "1.0"); }
public void TestGetConfigSuccessful() { IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy(); IServiceCommunicator serviceCommunicator = MockServiceCommunicator(); IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient(_url, _username, _password, serviceCommunicator, basicAuthStrategy); ConfigModel model = stamprApiClient.GetConfig(4679).First(); 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.AreEqual(model.Config_Id, 4679); Assert.AreEqual(model.User_Id, 1); Assert.AreEqual(model.Version, "1.0"); }