public void MultipleFieldsAreSeparated() { var helper = new QueryHelper(ValidHostname); helper.AppendField("name", "indiana-jones"); helper.AppendField("occupation", "archaeologist"); Assert.Equal("test.com?name=indiana-jones&occupation=archaeologist", helper.ToString()); }
public void AddingNullFieldValueAddsEmptyField() { var helper = new QueryHelper(ValidHostname); helper.AppendField("name", null); Assert.Equal("test.com?name=", helper.ToString()); }
public void AddingValidFieldValueAddsField() { var helper = new QueryHelper(ValidHostname); helper.AppendField("name", "indiana-jones"); Assert.Equal("test.com?name=indiana-jones", helper.ToString()); }
public void AddingNullFieldThrowsException() { var result = new QueryHelper(ValidHostname); Assert.Throws(typeof (ArgumentOutOfRangeException), () => { result.AppendField(null, "Anything"); }); }