Exemple #1
0
        public void TestPostBatchUnsuccessful()
        {
            IAuthorizationStrategy basicAuthStrategy   = MockAuthStrategy();
            IServiceCommunicator   serviceCommunicator = MockServiceCommunicator();
            IStamprApiClient       stamprApiClient     = new StamprApiClient.StamprApiClient("http://no", _username, _password, serviceCommunicator, basicAuthStrategy);

            Assert.Throws <ServiceCommunicationException>(() => stamprApiClient.CreateBatch(1, "", Status.hold));
        }
Exemple #2
0
        public void TestPostBatchInvalidPostStatus()
        {
            IAuthorizationStrategy basicAuthStrategy   = MockAuthStrategy();
            IServiceCommunicator   serviceCommunicator = MockServiceCommunicator();
            IStamprApiClient       stamprApiClient     = new StamprApiClient.StamprApiClient("http://no", _username, _password, serviceCommunicator, basicAuthStrategy);

            Assert.Throws <ArgumentException>(() => stamprApiClient.CreateBatch(1, "", Status.archive));
        }
Exemple #3
0
        public void TestPostBatch()
        {
            IAuthorizationStrategy basicAuthStrategy   = MockAuthStrategy();
            IServiceCommunicator   serviceCommunicator = MockServiceCommunicator();
            IStamprApiClient       stamprApiClient     = new StamprApiClient.StamprApiClient(_url, _username, _password, serviceCommunicator, basicAuthStrategy);
            BatchModel             postModel           = new BatchModel()
            {
                Config_Id = 4769,
                Status    = Status.processing,
                Template  = "Hello"
            };

            BatchModel model = stamprApiClient.CreateBatch(postModel);

            Assert.AreEqual(model.Config_Id, postModel.Config_Id);
            Assert.AreEqual(model.Status, postModel.Status);
            Assert.AreEqual(model.Template, postModel.Template);
            Assert.Greater(model.Batch_Id, 0);
            Assert.Greater(model.User_Id, 0);
        }
        public void TestPostBatch()
        {
            IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy();
            IServiceCommunicator serviceCommunicator = MockServiceCommunicator();
            IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient(_url, _username, _password, serviceCommunicator, basicAuthStrategy);
            BatchModel postModel = new BatchModel()
            {
                Config_Id = 4769,
                Status = Status.processing,
                Template = "Hello"
            };

            BatchModel model = stamprApiClient.CreateBatch(postModel);
            Assert.AreEqual(model.Config_Id, postModel.Config_Id);
            Assert.AreEqual(model.Status, postModel.Status);
            Assert.AreEqual(model.Template, postModel.Template);
            Assert.Greater(model.Batch_Id, 0);
            Assert.Greater(model.User_Id, 0);
        }
 public void TestPostBatchUnsuccessful()
 {
     IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy();
     IServiceCommunicator serviceCommunicator = MockServiceCommunicator();
     IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient("http://no", _username, _password, serviceCommunicator, basicAuthStrategy);
     Assert.Throws<ServiceCommunicationException>(() => stamprApiClient.CreateBatch(1,"", Status.hold));
 }
 public void TestPostBatchInvalidPostStatus()
 {
     IAuthorizationStrategy basicAuthStrategy = MockAuthStrategy();
     IServiceCommunicator serviceCommunicator = MockServiceCommunicator();
     IStamprApiClient stamprApiClient = new StamprApiClient.StamprApiClient("http://no", _username, _password, serviceCommunicator, basicAuthStrategy);
     Assert.Throws<ArgumentException>(() => stamprApiClient.CreateBatch(1, "", Status.archive));
 }