Beispiel #1
0
        public void AddFormSubmissionMode_adds_value(FormSubmissionMode mode, string value)
        {
            var builder = new HttpQueryStringBuilder();

            HttpQueryStringBuilderExtensions.AddFormSubmissionMode(builder, mode);

            Assume.That(builder.HasKey("formSubmissionMode"));

            var query = builder.BuildQuery();

            Assert.That(query.Query, Contains.Substring($"formSubmissionMode={value}"));
        }
Beispiel #2
0
        public void AddFormSubmissionMode_formSubmissionMode_must_be_a_valid_mode()
        {
            var builder = new HttpQueryStringBuilder();

            Assert.Throws <ArgumentOutOfRangeException>(() => HttpQueryStringBuilderExtensions.AddFormSubmissionMode(builder, (FormSubmissionMode)100));
        }
Beispiel #3
0
 public void AddFormSubmissionMode_builder_is_required(FormSubmissionMode testValue)
 {
     Assert.Throws <ArgumentNullException>(() => HttpQueryStringBuilderExtensions.AddFormSubmissionMode(null, testValue));
 }