public void TestGetBatchUnsuccessful()
 {
     IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy();
     IServiceCommunicator serviceCommunicator = MockServiceCommunicator();
     IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient("http://no", _username, _password, serviceCommunicator, basicAuthStrategy);
     Assert.Throws<ServiceCommunicationException>(() => stamprApiClient.GetBatches(4679));
 }
Exemple #2
0
        public void TestSearchBatchInvalidSearch()
        {
            IAuthorizationStrategy basicAuthStrategy   = MockAuthStrategy();
            IServiceCommunicator   serviceCommunicator = MockServiceCommunicator();
            IStamprApiClient       stamprApiClient     = new StamprApiClient.StamprApiClient(_url, _username, _password, serviceCommunicator, basicAuthStrategy);

            Assert.Throws <ArgumentException>(() => stamprApiClient.GetBatches(new SearchModel <Status>()));
        }
Exemple #3
0
        public void TestSearchBatchUnsuccessful()
        {
            IAuthorizationStrategy basicAuthStrategy   = MockAuthStrategy();
            IServiceCommunicator   serviceCommunicator = MockServiceCommunicator();
            IStamprApiClient       stamprApiClient     = new StamprApiClient.StamprApiClient("http://no", _username, _password, serviceCommunicator, basicAuthStrategy);

            Assert.Throws <ServiceCommunicationException>(() => stamprApiClient.GetBatches(Status.processing));
        }
 public void TestGetBatchSuccessful()
 {
     IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy();
     IServiceCommunicator serviceCommunicator = MockServiceCommunicator();
     IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient(_url, _username, _password, serviceCommunicator, basicAuthStrategy);
     BatchModel model = stamprApiClient.GetBatches(4679).First();
     Assert.AreEqual(model.Config_Id, 4679);
     Assert.AreEqual(model.Status, Status.processing);
     Assert.AreEqual(model.Template, "Hello");
     Assert.AreEqual(model.Batch_Id, 1904);
     Assert.AreEqual(model.User_Id, 1);
     Assert.AreEqual(model.Version, "1.0");
 }
Exemple #5
0
        public void TestSearchBatchSuccessful()
        {
            IAuthorizationStrategy basicAuthStrategy   = MockAuthStrategy();
            IServiceCommunicator   serviceCommunicator = MockServiceCommunicator();
            IStamprApiClient       stamprApiClient     = new StamprApiClient.StamprApiClient(_url, _username, _password, serviceCommunicator, basicAuthStrategy);
            BatchModel             model = stamprApiClient.GetBatches(Status.processing).First();

            Assert.AreEqual(model.Config_Id, 4679);
            Assert.AreEqual(model.Status, Status.processing);
            Assert.AreEqual(model.Template, "Hello");
            Assert.AreEqual(model.Batch_Id, 1904);
            Assert.AreEqual(model.User_Id, 1);
            Assert.AreEqual(model.Version, "1.0");
        }
 public void TestSearchBatchInvalidSearch()
 {
     IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy();
     IServiceCommunicator serviceCommunicator = MockServiceCommunicator();
     IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient(_url, _username, _password, serviceCommunicator, basicAuthStrategy);
     Assert.Throws<ArgumentException>(() => stamprApiClient.GetBatches(new SearchModel<Status>()));
 }