Esempio n. 1
0
        public bool TryInitialize()
        {
            try {
                var api = new MandrillApi(_ctx.Setting.MandrillApiKey);

                api.Ping();
            } catch (Exception ex) {
                _ctx.Logger.Fatal(ex, "Unable to connect to Mandrill api. Check MandrillApiKey setting.");
            }

            return(false);
        }
Esempio n. 2
0
        public void Ping_Throws_Exception_On_Invalid_ApiKey()
        {
            // Setup
            var apiKey = " ";

            // Exercise
            var api = new MandrillApi(apiKey);

            // Verify
            var ex = Assert.Throws<MandrillException>(() => api.Ping());
            Assert.That(ex.Error.name, Is.EqualTo("Invalid_Key"));
        }
Esempio n. 3
0
    public async Task Should_Throw_Exception_On_Invalid_ApiKey()
    {
      // Setup
      string apiKey = " ";

      // Exercise
      var api = new MandrillApi(apiKey);

      // Verify
      var ex = Assert.Throws<MandrillException>(async () => await api.Ping());
      Assert.That(ex.Error.Name, Is.EqualTo("Invalid_Key"));
    }
Esempio n. 4
0
        public async Task Should_Throw_Exception_On_Invalid_ApiKey()
        {
            // Setup
            var apiKey = " ";

            // Exercise
            var api = new MandrillApi(apiKey);

            // Verify
            var ex = await Assert.ThrowsAsync <MandrillException>(async() => await api.Ping());

            Assert.Equal(ex.Error.Name, "Invalid_Key");
        }
Esempio n. 5
0
        public void Ping_Throws_Exception_On_Invalid_ApiKey()
        {
            // Setup
            var apiKey = " ";

            // Exercise
            var api = new MandrillApi(apiKey);

            // Verify
            var ex = Assert.Throws <MandrillException>(() => api.Ping());

            Assert.That(ex.Error.name, Is.EqualTo("Invalid_Key"));
        }
Esempio n. 6
0
        public async Task Should_Return_Pong_On_Valid_ApiKey()
        {
            // Setup
            var apiKey = Settings.ApiKey;

            // Exercise
            var api    = new MandrillApi(apiKey);
            var result = await api.Ping();

            var expected = "PONG!";

            // Verify
            Assert.Equal(expected, result);
        }
Esempio n. 7
0
    public async Task Should_Return_Pong_On_Valid_ApiKey()
    {
      // Setup
      string apiKey = ConfigurationManager.AppSettings["APIKey"];

      // Exercise
      var api = new MandrillApi(apiKey);
      string result = await api.Ping();

      string expected = "PONG!";

      // Verify
      Assert.AreEqual(expected, result);
    }
Esempio n. 8
0
        public async Task Should_Return_Pong_On_Valid_ApiKey()
        {
            // Setup
            string apiKey = ConfigurationManager.AppSettings["APIKey"];

            // Exercise
            var    api    = new MandrillApi(apiKey);
            string result = await api.Ping();

            string expected = "PONG!";

            // Verify
            Assert.AreEqual(expected, result);
        }
Esempio n. 9
0
        public void Ping_Returns_Pong_On_Valid_ApiKey()
        {
            // Setup
            var apiKey = ConfigurationManager.AppSettings["APIKey"];

            // Exercise
            var api = new MandrillApi(apiKey);
            string result = api.Ping();

            string expected = "\"PONG!\"";

            // Verify
            Assert.AreEqual(expected, result);
        }
Esempio n. 10
0
        public void Ping_Returns_Pong_On_Valid_ApiKey()
        {
            // Setup
            var apiKey = ConfigurationManager.AppSettings["APIKey"];

            // Exercise
            var    api    = new MandrillApi(apiKey);
            string result = api.Ping();

            string expected = "\"PONG!\"";

            // Verify
            Assert.AreEqual(expected, result);
        }