Пример #1
0
        public void CtorString()
        {
            ParameterizedStringPart part = new ParameterizedStringPart("literal-text");

            Assert.IsNotNull(part);
            Assert.Pass();
        }
Пример #2
0
        public void CtorStringString()
        {
            ParameterizedStringPart part = new ParameterizedStringPart("somename", "somevalue");

            Assert.IsNotNull(part);
            Assert.Pass();
        }
Пример #3
0
        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]);
 }
Пример #5
0
        public void NotEquals()
        {
            ParameterizedStringPart part  = new ParameterizedStringPart("somedata");
            ParameterizedStringPart part2 = new ParameterizedStringPart("somedata2");

            Assert.IsFalse(part.Equals(part2));
            Assert.IsTrue(part != part2);
        }
Пример #6
0
        public void CopyToNullArray()
        {
            ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection();

            ParameterizedStringPart[] parts = new ParameterizedStringPart[1];

            collection.CopyTo(null, 0);
        }
Пример #7
0
        public void AddDuplicate()
        {
            ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection();
            ParameterizedStringPart           part       = new ParameterizedStringPart("somename", "somedata");

            collection.Add(part);
            collection.Add(part);
        }
Пример #8
0
        public void RemovePart()
        {
            ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection();
            ParameterizedStringPart           part       = new ParameterizedStringPart("somename", "somedata");

            collection.Add(part);
            Assert.IsTrue(collection.Remove(part));
        }
Пример #9
0
        public void EmptyCopyTo()
        {
            ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection();

            ParameterizedStringPart[] parts = new ParameterizedStringPart[1];
            collection.CopyTo(parts, 0);
            Assert.IsNull(parts[0]);
        }
Пример #10
0
        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);
        }
Пример #11
0
        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);
        }
Пример #14
0
        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);
        }
Пример #15
0
        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 NotEquals()
 {
     ParameterizedStringPart part = new ParameterizedStringPart("somedata");
     ParameterizedStringPart part2 = new ParameterizedStringPart("somedata2");
     Assert.IsFalse(part.Equals(part2));
     Assert.IsTrue(part != part2);
 }
 public void AddDuplicate() {
     ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection();
     ParameterizedStringPart part = new ParameterizedStringPart("somename", "somedata");
     collection.Add(part);
     collection.Add(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 CtorStringString()
 {
     ParameterizedStringPart part = new ParameterizedStringPart("somename", "somevalue");
     Assert.IsNotNull(part);
     Assert.Pass();
 }
 public void CtorNull()
 {
     ParameterizedStringPart part = new ParameterizedStringPart(null);
 }
 public void CtorEmptyString()
 {
     ParameterizedStringPart part = new ParameterizedStringPart(string.Empty, "somevalue");
 }
Пример #22
0
 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);
 }
Пример #27
0
        public void NullEqualsNull()
        {
            ParameterizedStringPart part = null;

            Assert.IsTrue(part == null);
        }
        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);
        }
Пример #29
0
 public void CtorNull()
 {
     ParameterizedStringPart part = new ParameterizedStringPart(null);
 }
        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 CtorNullString()
 {
     ParameterizedStringPart part = new ParameterizedStringPart(null, "somevalue");
 }
Пример #32
0
 public void CtorEmptyString()
 {
     ParameterizedStringPart part = new ParameterizedStringPart(string.Empty, "somevalue");
 }
 public void CtorStringEmpty()
 {
     ParameterizedStringPart part = new ParameterizedStringPart("somename", string.Empty);
 }
Пример #34
0
        public void IsParameter()
        {
            ParameterizedStringPart part = new ParameterizedStringPart("string", "string");

            Assert.IsTrue(part.IsParameter);
        }
 public void CtorString() {
     ParameterizedStringPart part = new ParameterizedStringPart("literal-text");
     Assert.IsNotNull(part);
     Assert.Pass();
 }
Пример #36
0
        public void IsNotParameter()
        {
            ParameterizedStringPart part = new ParameterizedStringPart("sometext");

            Assert.IsFalse(part.IsParameter);
        }
        public void CopyToNullArray() {
            ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection();
            ParameterizedStringPart[] parts = new ParameterizedStringPart[1];

            collection.CopyTo(null, 0);
        }
Пример #38
0
        public void LiteralValue()
        {
            ParameterizedStringPart part = new ParameterizedStringPart("literal-value");

            Assert.AreEqual("literal-value", part.LiteralValue);
        }
 public void RemovePartInexistent()
 {
     ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection();
     ParameterizedStringPart part = new ParameterizedStringPart("literal-value");
     Assert.IsFalse(collection.Remove(part));
 }
Пример #40
0
        public void EmptyLiteralValue()
        {
            ParameterizedStringPart part = new ParameterizedStringPart(string.Empty);

            Assert.AreEqual(string.Empty, part.LiteralValue);
        }
 public void RemovePart()
 {
     ParameterizedStringPartCollection collection = new ParameterizedStringPartCollection();
     ParameterizedStringPart part = new ParameterizedStringPart("somename", "somedata");
     collection.Add(part);
     Assert.IsTrue(collection.Remove(part));
 }
Пример #42
0
        public void ParameterName()
        {
            ParameterizedStringPart part = new ParameterizedStringPart("somename", "somevalue");

            Assert.AreEqual(part.ParameterName, "somename");
        }
Пример #43
0
 public void CtorNullString()
 {
     ParameterizedStringPart part = new ParameterizedStringPart(null, "somevalue");
 }
 public void ParameterName()
 {
     ParameterizedStringPart part = new ParameterizedStringPart("somename", "somevalue");
     Assert.AreEqual(part.ParameterName, "somename");
 }