public async void AdminClient_CanEditServer()
        {
            var newServer = await _adminClient.CreateServerAsync(_name, _color, _rawEmailEnabled, _smtpActivated,
                                                                 _inboundHookUrl, _bounceHookUrl, _openHookUrl, _postFirstOpenOpenOnly, _trackOpens,
                                                                 null, _inboundSpamThreshold);

            var updatedAffix = "updated";

            var updatedServer = await _adminClient.EditServerAsync(newServer.ID, _name + updatedAffix, ServerColors.Yellow,
                                                                   !newServer.RawEmailEnabled, !newServer.SmtpApiActivated,
                                                                   _inboundHookUrl + updatedAffix, _bounceHookUrl + updatedAffix,
                                                                   _openHookUrl + updatedAffix, !newServer.PostFirstOpenOnly,
                                                                   !newServer.TrackOpens, null, 5);

            var retrievedServer = await _adminClient.GetServerAsync(newServer.ID);

            Assert.AreEqual(_name + updatedAffix, retrievedServer.Name);
            Assert.AreEqual(ServerColors.Yellow, retrievedServer.Color);
            Assert.AreNotEqual(newServer.Color, retrievedServer.Color);
            Assert.AreEqual(!_rawEmailEnabled, retrievedServer.RawEmailEnabled);
            Assert.AreEqual(!_smtpActivated, retrievedServer.SmtpApiActivated);
            Assert.AreEqual(_inboundHookUrl + updatedAffix, retrievedServer.InboundHookUrl);
            Assert.AreEqual(_bounceHookUrl + updatedAffix, retrievedServer.BounceHookUrl);
            Assert.AreEqual(_openHookUrl + updatedAffix, retrievedServer.OpenHookUrl);
            Assert.AreEqual(!_postFirstOpenOpenOnly, retrievedServer.PostFirstOpenOnly);
            Assert.AreEqual(!_trackOpens, retrievedServer.TrackOpens);
            //Assert.AreEqual(updatedAffix + _inboundDomain, retrievedServer.InboundDomain);
            Assert.AreEqual(5, retrievedServer.InboundSpamThreshold);
            Assert.AreNotEqual(newServer.InboundSpamThreshold, retrievedServer.InboundSpamThreshold);
        }
 protected override void Setup()
 {
     _adminClient = new PostmarkAdminClient(WRITE_ACCOUNT_TOKEN, BASE_URL);
     _server      = TestUtils.MakeSynchronous(() => _adminClient.CreateServerAsync($"integration-test-message-stream-{Guid.NewGuid()}"));
     _client      = new PostmarkClient(_server.ApiTokens.First(), BASE_URL);
 }
Esempio n. 3
0
 protected override void Setup()
 {
     _adminClient = new PostmarkAdminClient(WRITE_ACCOUNT_TOKEN, BASE_URL);
     _server      = _adminClient.CreateServerAsync($"integration-test-webhooks-{Guid.NewGuid()}").Result;
     _client      = new PostmarkClient(_server.ApiTokens.First(), BASE_URL);
 }