public void CtorString() { ParameterizedStringPart part = new ParameterizedStringPart("literal-text"); Assert.IsNotNull(part); Assert.Pass(); }
public void CtorStringString() { ParameterizedStringPart part = new ParameterizedStringPart("somename", "somevalue"); Assert.IsNotNull(part); Assert.Pass(); }
public void RemovePartInexistent() { ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection(); ParameterizedStringPart part = new ParameterizedStringPart("literal-value"); Assert.IsFalse(collection.Remove(part)); }
public void EmptyCopyTo() { ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection(); ParameterizedStringPart[] parts = new ParameterizedStringPart[1]; collection.CopyTo(parts, 0); Assert.IsNull(parts[0]); }
public void NotEquals() { ParameterizedStringPart part = new ParameterizedStringPart("somedata"); ParameterizedStringPart part2 = new ParameterizedStringPart("somedata2"); Assert.IsFalse(part.Equals(part2)); Assert.IsTrue(part != part2); }
public void CopyToNullArray() { ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection(); ParameterizedStringPart[] parts = new ParameterizedStringPart[1]; collection.CopyTo(null, 0); }
public void AddDuplicate() { ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection(); ParameterizedStringPart part = new ParameterizedStringPart("somename", "somedata"); collection.Add(part); collection.Add(part); }
public void RemovePart() { ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection(); ParameterizedStringPart part = new ParameterizedStringPart("somename", "somedata"); collection.Add(part); Assert.IsTrue(collection.Remove(part)); }
public void CopyToOverflowIndex() { ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection(); ParameterizedStringPart[] parts = new ParameterizedStringPart[1]; collection.Add(new ParameterizedStringPart("somename", "somevalue")); collection.Add(new ParameterizedStringPart("othername", "othervalue")); collection.CopyTo(parts, 3); }
public void NotEqualsNull() { ParameterizedStringPart part = new ParameterizedStringPart("somedata"); Assert.IsFalse(part.Equals(null)); Assert.IsTrue(part != null); part = new ParameterizedStringPart("somename", "somedata"); Assert.IsFalse(part.Equals(null)); Assert.IsTrue(part != null); }
public void ShouldThrowArgumentExceptionWhenOneOrMoreElementsAreNull() { Assert.Throws<ArgumentException>(delegate() { ParameterizedStringPart[] parts = new ParameterizedStringPart[2]; parts[0] = new ParameterizedStringPartParameter("name"); parts[1] = null; ParameterizedString s = ParameterizedString.FromParameterizedStringPartCollection(parts, "$"); }); }
public void CopyToZeroIndex() { ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection(); ParameterizedStringPart[] parts = new ParameterizedStringPart[2]; collection.Add(new ParameterizedStringPart("somename", "somevalue")); collection.Add(new ParameterizedStringPart("othername", "othervalue")); collection.CopyTo(parts, 0); Assert.IsNotNull(parts[0]); Assert.IsNotNull(parts[1]); Assert.AreEqual("somename", parts[0].ParameterName); Assert.AreEqual("othername", parts[1].ParameterName); }
public void Equals() { ParameterizedStringPart part = new ParameterizedStringPart("somedata"); Assert.IsTrue(part.Equals(part)); Assert.IsTrue(part == part); ParameterizedStringPart part2 = new ParameterizedStringPart("somedata"); Assert.IsTrue(part.Equals(part2)); Assert.IsTrue(part == part2); part = new ParameterizedStringPart("somename", "somevalue"); Assert.IsTrue(part.Equals(part)); Assert.IsTrue(part == part); part2 = new ParameterizedStringPart("somename", "somevalue"); Assert.IsTrue(part.Equals(part2)); Assert.IsTrue(part == part2); }
public void CtorNull() { ParameterizedStringPart part = new ParameterizedStringPart(null); }
public void CtorEmptyString() { ParameterizedStringPart part = new ParameterizedStringPart(string.Empty, "somevalue"); }
public void CtorStringEmpty() { ParameterizedStringPart part = new ParameterizedStringPart("somename", string.Empty); }
public void IsParameter() { ParameterizedStringPart part = new ParameterizedStringPart("string", "string"); Assert.IsTrue(part.IsParameter); }
public void IsNotParameter() { ParameterizedStringPart part = new ParameterizedStringPart("sometext"); Assert.IsFalse(part.IsParameter); }
public void LiteralValue() { ParameterizedStringPart part = new ParameterizedStringPart("literal-value"); Assert.AreEqual("literal-value", part.LiteralValue); }
public void EmptyLiteralValue() { ParameterizedStringPart part = new ParameterizedStringPart(string.Empty); Assert.AreEqual(string.Empty, part.LiteralValue); }
public void NullEqualsNull() { ParameterizedStringPart part = null; Assert.IsTrue(part == null); }
public void CtorNullString() { ParameterizedStringPart part = new ParameterizedStringPart(null, "somevalue"); }
public void ParameterName() { ParameterizedStringPart part = new ParameterizedStringPart("somename", "somevalue"); Assert.AreEqual(part.ParameterName, "somename"); }