Пример #1
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.UserInfo());
      Assert.That(ex.Error.Name, Is.EqualTo("Invalid_Key"));
    }
Пример #2
0
        public void UserInfo_Throws_Exception_On_Invalid_ApiKey()
        {
            // Setup
            var apiKey = " ";

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

            // Verify
            var ex = Assert.Throws<MandrillException>(() => api.UserInfo());
            Assert.That(ex.Error.name, Is.EqualTo("Invalid_Key"));
        }
Пример #3
0
    public async Task Should_Return_Info()
    {
      // Setup
      string apiKey = ConfigurationManager.AppSettings["APIKey"];
      string username = ConfigurationManager.AppSettings["Username"];

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

      // Verify
      Assert.AreEqual(username, result.Username);
    }
Пример #4
0
        public void UserInfo_Throws_Exception_On_Invalid_ApiKey()
        {
            // Setup
            var apiKey = " ";

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

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

            Assert.That(ex.Error.name, Is.EqualTo("Invalid_Key"));
        }
Пример #5
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.UserInfo());

            Assert.Equal(ex.Error.Name, "Invalid_Key");
        }