Lines Matching refs:Assert
51 Assert.Throws<ArgumentNullException>(() => list.Add((string)null)); in NullValuesRejected()
52 Assert.Throws<ArgumentNullException>(() => list.Add((IEnumerable<string>)null)); in NullValuesRejected()
53 Assert.Throws<ArgumentNullException>(() => list.Add((RepeatedField<string>)null)); in NullValuesRejected()
54 Assert.Throws<ArgumentNullException>(() => list.Contains(null)); in NullValuesRejected()
55 Assert.Throws<ArgumentNullException>(() => list.IndexOf(null)); in NullValuesRejected()
63 Assert.AreEqual(1, list.Count); in Add_SingleItem()
64 Assert.AreEqual("foo", list[0]); in Add_SingleItem()
72 Assert.AreEqual(2, list.Count); in Add_Sequence()
73 Assert.AreEqual("foo", list[0]); in Add_Sequence()
74 Assert.AreEqual("bar", list[1]); in Add_Sequence()
82 Assert.AreEqual(3, list.Count); in Add_RepeatedField()
83 Assert.AreEqual("original", list[0]); in Add_RepeatedField()
84 Assert.AreEqual("foo", list[1]); in Add_RepeatedField()
85 Assert.AreEqual("bar", list[2]); in Add_RepeatedField()
97 Assert.AreEqual(0, list.Count); in RemoveAt_Valid()
104 Assert.Throws<ArgumentOutOfRangeException>(() => list.RemoveAt(-1)); in RemoveAt_Invalid()
105 Assert.Throws<ArgumentOutOfRangeException>(() => list.RemoveAt(3)); in RemoveAt_Invalid()
124 Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(-1, "foo")); in Insert_Invalid()
125 Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(3, "foo")); in Insert_Invalid()
126 Assert.Throws<ArgumentNullException>(() => list.Insert(0, null)); in Insert_Invalid()
133 Assert.IsFalse(list.Equals((RepeatedField<string>) null)); in Equals_RepeatedField()
134 Assert.IsTrue(list.Equals(list)); in Equals_RepeatedField()
135 Assert.IsFalse(list.Equals(new RepeatedField<string> { "first", "third" })); in Equals_RepeatedField()
136 Assert.IsFalse(list.Equals(new RepeatedField<string> { "first" })); in Equals_RepeatedField()
137 Assert.IsTrue(list.Equals(new RepeatedField<string> { "first", "second" })); in Equals_RepeatedField()
144 Assert.IsFalse(list.Equals((object) null)); in Equals_Object()
145 Assert.IsTrue(list.Equals((object) list)); in Equals_Object()
146 Assert.IsFalse(list.Equals((object) new RepeatedField<string> { "first", "third" })); in Equals_Object()
147 Assert.IsFalse(list.Equals((object) new RepeatedField<string> { "first" })); in Equals_Object()
148 Assert.IsTrue(list.Equals((object) new RepeatedField<string> { "first", "second" })); in Equals_Object()
149 Assert.IsFalse(list.Equals(new object())); in Equals_Object()
180 Assert.AreEqual("first", list[0]); in Indexer_Get()
181 Assert.AreEqual("second", list[1]); in Indexer_Get()
182 Assert.Throws<ArgumentOutOfRangeException>(() => list[-1].GetHashCode()); in Indexer_Get()
183 Assert.Throws<ArgumentOutOfRangeException>(() => list[2].GetHashCode()); in Indexer_Get()
191 Assert.AreEqual("changed", list[0]); in Indexer_Set()
192 Assert.Throws<ArgumentNullException>(() => list[0] = null); in Indexer_Set()
193 Assert.Throws<ArgumentOutOfRangeException>(() => list[-1] = "bad"); in Indexer_Set()
194 Assert.Throws<ArgumentOutOfRangeException>(() => list[2] = "bad"); in Indexer_Set()
211 Assert.IsTrue(enumerator.MoveNext()); in Enumerator()
212 Assert.AreEqual("first", enumerator.Current); in Enumerator()
213 Assert.IsTrue(enumerator.MoveNext()); in Enumerator()
214 Assert.AreEqual("second", enumerator.Current); in Enumerator()
215 Assert.IsFalse(enumerator.MoveNext()); in Enumerator()
216 Assert.IsFalse(enumerator.MoveNext()); in Enumerator()
245 Assert.IsTrue(input.IsAtEnd); in AddEntriesFrom_PackedInt32()
271 Assert.IsTrue(input.IsAtEnd); in AddEntriesFrom_NonPackedInt32()
294 Assert.IsTrue(input.IsAtEnd); in AddEntriesFrom_String()
318 Assert.IsTrue(input.IsAtEnd); in AddEntriesFrom_Message()
335 Assert.AreEqual(10, input.ReadInt32()); in WriteTo_PackedInt32()
336 Assert.AreEqual(1000, input.ReadInt32()); in WriteTo_PackedInt32()
337 Assert.AreEqual(1000000, input.ReadInt32()); in WriteTo_PackedInt32()
338 Assert.IsTrue(input.IsAtEnd); in WriteTo_PackedInt32()
339 … Assert.AreEqual(1 + CodedOutputStream.ComputeLengthSize(length) + length, stream.Length); in WriteTo_PackedInt32()
355 Assert.AreEqual(10, input.ReadInt32()); in WriteTo_NonPackedInt32()
357 Assert.AreEqual(1000, input.ReadInt32()); in WriteTo_NonPackedInt32()
359 Assert.AreEqual(1000000, input.ReadInt32()); in WriteTo_NonPackedInt32()
360 Assert.IsTrue(input.IsAtEnd); in WriteTo_NonPackedInt32()
376 Assert.AreEqual("Foo", input.ReadString()); in WriteTo_String()
378 Assert.AreEqual("", input.ReadString()); in WriteTo_String()
380 Assert.AreEqual("Bar", input.ReadString()); in WriteTo_String()
381 Assert.IsTrue(input.IsAtEnd); in WriteTo_String()
399 Assert.AreEqual(message1, input.ReadMessage(ForeignMessage.Parser)); in WriteTo_Message()
401 Assert.AreEqual(message2, input.ReadMessage(ForeignMessage.Parser)); in WriteTo_Message()
402 Assert.IsTrue(input.IsAtEnd); in WriteTo_Message()
411 Assert.AreEqual(7, list.CalculateSize(FieldCodec.ForInt32(tag))); in CalculateSize_VariableSizeNonPacked()
420 Assert.AreEqual(15, list.CalculateSize(FieldCodec.ForSFixed32(tag))); in CalculateSize_FixedSizeNonPacked()
430 Assert.AreEqual(6, list.CalculateSize(FieldCodec.ForInt32(tag))); in CalculateSize_VariableSizePacked()
439 Assert.AreEqual(14, list.CalculateSize(FieldCodec.ForSFixed32(tag))); in CalculateSize_FixedSizePacked()
456 Assert.AreEqual(0, output.SpaceLeft); in TestNegativeEnumArray()
464 Assert.AreEqual(6, values.Count); in TestNegativeEnumArray()
465 Assert.AreEqual(SampleEnum.None, values[0]); in TestNegativeEnumArray()
466 Assert.AreEqual(((SampleEnum)(-1)), values[1]); in TestNegativeEnumArray()
467 Assert.AreEqual(SampleEnum.NegativeValue, values[2]); in TestNegativeEnumArray()
468 Assert.AreEqual(((SampleEnum)(-3)), values[3]); in TestNegativeEnumArray()
469 Assert.AreEqual(((SampleEnum)(-4)), values[4]); in TestNegativeEnumArray()
470 Assert.AreEqual(((SampleEnum)(-5)), values[5]); in TestNegativeEnumArray()
494 Assert.AreEqual(0, output.SpaceLeft); in TestNegativeEnumPackedArray()
502 Assert.AreEqual(6, values.Count); in TestNegativeEnumPackedArray()
503 Assert.AreEqual(SampleEnum.None, values[0]); in TestNegativeEnumPackedArray()
504 Assert.AreEqual(((SampleEnum)(-1)), values[1]); in TestNegativeEnumPackedArray()
505 Assert.AreEqual(SampleEnum.NegativeValue, values[2]); in TestNegativeEnumPackedArray()
506 Assert.AreEqual(((SampleEnum)(-3)), values[3]); in TestNegativeEnumPackedArray()
507 Assert.AreEqual(((SampleEnum)(-4)), values[4]); in TestNegativeEnumPackedArray()
508 Assert.AreEqual(((SampleEnum)(-5)), values[5]); in TestNegativeEnumPackedArray()
517 Assert.AreEqual("first", list[0]); in IList_Indexer()
519 Assert.AreEqual("changed", field[1]); in IList_Indexer()
526 Assert.IsTrue(list.Contains("second")); in IList_Contains()
527 Assert.IsFalse(list.Contains("third")); in IList_Contains()
528 Assert.IsFalse(list.Contains(new object())); in IList_Contains()
554 Assert.IsFalse(list.IsFixedSize); in IList_IsFixedSize()
561 Assert.AreEqual(1, list.IndexOf("second")); in IList_IndexOf()
562 Assert.AreEqual(-1, list.IndexOf("third")); in IList_IndexOf()
563 Assert.AreEqual(-1, list.IndexOf(new object())); in IList_IndexOf()
570 Assert.AreSame(list, list.SyncRoot); in IList_SyncRoot()
585 Assert.Throws<ArrayTypeMismatchException>(() => list.CopyTo(new StringBuilder[4], 1)); in IList_CopyTo()
586 Assert.Throws<ArrayTypeMismatchException>(() => list.CopyTo(new int[4], 1)); in IList_CopyTo()
593 Assert.IsFalse(list.IsSynchronized); in IList_IsSynchronized()
609 Assert.AreEqual("[ 5, 10, 20 ]", text); in ToString_Integers()
617 Assert.AreEqual("[ \"x\", \"y\", \"z\" ]", text); in ToString_Strings()
625 Assert.AreEqual("[ { \"singleDouble\": 1.5 }, { \"singleInt32\": 10 } ]", text); in ToString_Messages()
633 Assert.AreEqual("[ ]", text); in ToString_Empty()
640 Assert.Throws<ArgumentException>(() => list.ToString()); in ToString_InvalidElementType()
648 Assert.AreEqual("[ \"2015-10-01T12:34:56Z\" ]", text); in ToString_Timestamp()
657 Assert.AreEqual(text, "[ { \"foo\": 20 } ]", message.ToString()); in ToString_Struct()