public void TestPutAsync_SurveyIdIsWhitespace_Throws()
        {
            var target = new NfieldSurveyEmailSettingsService();

            Assert.Throws <ArgumentException>(() =>
                                              UnwrapAggregateException(target.PutAsync("   ", new SurveyEmailSettings())));
        }
        public void TestPutAsync_SettingsNull_Throws()
        {
            var target = new NfieldSurveyEmailSettingsService();

            Assert.Throws <ArgumentNullException>(() =>
                                                  UnwrapAggregateException(target.PutAsync("anything", null)));
        }
        public void TestPutAsync_SurveyExists_ReturnsData()
        {
            var expected = GetTestEmailSettings();

            var target     = new NfieldSurveyEmailSettingsService();
            var mockClient = InitMockClientPut(GetEmailSettingsUrl(SurveyId), expected, expected);

            target.InitializeNfieldConnection(mockClient);

            var actual = target.PutAsync(SurveyId, expected).Result;

            AssertOnEmailSettings(expected, actual);
        }
        public void TestGetAsync_SurveyExists_ReturnsData()
        {
            var expected    = GetTestEmailSettings();
            var expectedDto = new SurveyEmailSettingsResponse
            {
                SurveyEmailSettings = expected
            };

            var target     = new NfieldSurveyEmailSettingsService();
            var mockClient = InitMockClientGet(GetEmailSettingsUrl(SurveyId), expectedDto);

            target.InitializeNfieldConnection(mockClient);

            var actual = target.GetAsync(SurveyId).Result;

            AssertOnEmailSettings(expected, actual.SurveyEmailSettings);
        }
        public void TestGetAsync_SurveyIdIsEmpty_Throws()
        {
            var target = new NfieldSurveyEmailSettingsService();

            Assert.Throws <ArgumentException>(() => UnwrapAggregateException(target.GetAsync(string.Empty)));
        }