예제 #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);
        }
예제 #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"));
        }
예제 #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"));
    }
예제 #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");
        }
예제 #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"));
        }
예제 #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);
        }
예제 #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);
    }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }