Exemple #1
0
        public void AddProperties_builder_is_required(string fieldName)
        {
            var properties = new IProperty[]
            {
                ContactProperties.FirstName
            };

            Assert.Throws <ArgumentNullException>(() => HttpQueryStringBuilderExtensions.AddProperties(null, properties, fieldName));
        }
Exemple #2
0
        public void AddProperties_fieldName_is_required()
        {
            var builder = new HttpQueryStringBuilder();

            var properties = new IProperty[]
            {
                ContactProperties.FirstName
            };

            Assert.Throws <ArgumentNullException>(() => HttpQueryStringBuilderExtensions.AddProperties(builder, properties, null));
        }
Exemple #3
0
        public void AddProperties_adds_all_properties(string fieldName)
        {
            var builder = new HttpQueryStringBuilder();

            var properties = new IProperty[]
            {
                ContactProperties.FirstName
            };

            HttpQueryStringBuilderExtensions.AddProperties(builder, properties, fieldName);

            Assume.That(builder.HasKey(fieldName), Is.True);

            var query = builder.BuildQuery();

            Assert.That(query.Query, Contains.Substring($"{fieldName}={ContactProperties.FirstName.Name}"));
        }