コード例 #1
0
        public void Subaccount_Info_Returns_Subaccount()
        {
            // Setup
            var apiKey = ConfigurationManager.AppSettings["APIKey"];

            var subaccount = new SubaccountInfo {
                Id = Guid.NewGuid().ToString(), CustomQuota = 10, Name = "subaccount1"
            };

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

            var result = api.AddSubaccount(subaccount);

            var infoSubaccount = api.SubaccountInfo(subaccount.Id);

            // Verify
            Assert.IsNotNull(infoSubaccount);
            Assert.AreEqual(infoSubaccount.Id, subaccount.Id);
        }
コード例 #2
0
    public async Task Subaccount_Info_Returns_Subaccount()
    {
      // Setup
      string apiKey = ConfigurationManager.AppSettings["APIKey"];

      var subaccount = new AddSubAccountRequest(Guid.NewGuid().ToString()) {CustomQuota = 10, Name = "subaccount1"};

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

      SubaccountInfo result = await api.AddSubaccount(subaccount);

      SubaccountInfo infoSubaccount = await api.SubaccountInfo(new SubAccountInfoRequest(subaccount.Id));

      // Verify
      Assert.IsNotNull(infoSubaccount);
      Assert.AreEqual(infoSubaccount.Id, subaccount.Id);

      // Cleanup
      await api.DeleteSubaccount(new DeleteSubAccountRequest(subaccount.Id));
    }
コード例 #3
0
        public async Task Subaccount_Info_Returns_Subaccount()
        {
            // Setup
            string apiKey = ConfigurationManager.AppSettings["APIKey"];

            var subaccount = new AddSubAccountRequest(Guid.NewGuid().ToString())
            {
                CustomQuota = 10, Name = "subaccount1"
            };

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

            SubaccountInfo result = await api.AddSubaccount(subaccount);

            SubaccountInfo infoSubaccount = await api.SubaccountInfo(new SubAccountInfoRequest(subaccount.Id));

            // Verify
            Assert.IsNotNull(infoSubaccount);
            Assert.AreEqual(infoSubaccount.Id, subaccount.Id);

            // Cleanup
            await api.DeleteSubaccount(new DeleteSubAccountRequest(subaccount.Id));
        }
コード例 #4
0
        public void Subaccount_Info_Returns_Subaccount()
        {
            // Setup
            var apiKey = ConfigurationManager.AppSettings["APIKey"];

            var subaccount = new SubaccountInfo { Id = Guid.NewGuid().ToString(), CustomQuota = 10, Name = "subaccount1" };

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

            var result = api.AddSubaccount(subaccount);

            var infoSubaccount = api.SubaccountInfo(subaccount.Id);

            // Verify
            Assert.IsNotNull(infoSubaccount);
            Assert.AreEqual(infoSubaccount.Id, subaccount.Id);
        }