public void AddingValidFieldValueAddsField() { var helper = new QueryHelper(ValidHostname); helper.AppendField("name", "indiana-jones"); Assert.Equal("test.com?name=indiana-jones", helper.ToString()); }
public void AddingNullFieldValueAddsEmptyField() { var helper = new QueryHelper(ValidHostname); helper.AppendField("name", null); Assert.Equal("test.com?name=", helper.ToString()); }
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 AddingNullFieldThrowsException() { var result = new QueryHelper(ValidHostname); Assert.Throws(typeof (ArgumentOutOfRangeException), () => { result.AppendField(null, "Anything"); }); }
public void ProperConstructionReturnsBaseString() { var result = new QueryHelper(ValidHostname); Assert.Equal(ValidHostname, result.ToString()); }
public void EmptyStringReturnsEmpty() { var result = new QueryHelper(String.Empty); Assert.Equal(String.Empty, result.ToString()); }