• Home
  • Raw
  • Download

Lines Matching refs:Assert

52             Assert.Throws<ArgumentNullException>(() => list.Add((string)null));  in NullValuesRejected()
53 Assert.Throws<ArgumentNullException>(() => list.Add((IEnumerable<string>)null)); in NullValuesRejected()
54 Assert.Throws<ArgumentNullException>(() => list.Add((RepeatedField<string>)null)); in NullValuesRejected()
55 Assert.Throws<ArgumentNullException>(() => list.Contains(null)); in NullValuesRejected()
56 Assert.Throws<ArgumentNullException>(() => list.IndexOf(null)); in NullValuesRejected()
64 Assert.AreEqual(1, list.Count); in Add_SingleItem()
65 Assert.AreEqual("foo", list[0]); in Add_SingleItem()
73 Assert.AreEqual(2, list.Count); in Add_Sequence()
74 Assert.AreEqual("foo", list[0]); in Add_Sequence()
75 Assert.AreEqual("bar", list[1]); in Add_Sequence()
83 Assert.AreEqual(2, list.Count); in AddRange_SlowPath()
84 Assert.AreEqual("foo", list[0]); in AddRange_SlowPath()
85 Assert.AreEqual("bar", list[1]); in AddRange_SlowPath()
94Assert.Catch<ArgumentException>(() => list.AddRange(new[] { "foo", null }.Select(x => x))); in AddRange_SlowPath_NullsProhibited_ReferenceType()
103Assert.Catch<ArgumentException>(() => list.AddRange(new[] { 20, (int?)null }.Select(x => x))); in AddRange_SlowPath_NullsProhibited_NullableValueType()
111 Assert.AreEqual(2, list.Count); in AddRange_Optimized_NonNullableValueType()
112 Assert.AreEqual(20, list[0]); in AddRange_Optimized_NonNullableValueType()
113 Assert.AreEqual(30, list[1]); in AddRange_Optimized_NonNullableValueType()
121 Assert.AreEqual(2, list.Count); in AddRange_Optimized_ReferenceType()
122 Assert.AreEqual("foo", list[0]); in AddRange_Optimized_ReferenceType()
123 Assert.AreEqual("bar", list[1]); in AddRange_Optimized_ReferenceType()
131 Assert.AreEqual(2, list.Count); in AddRange_Optimized_NullableValueType()
132 Assert.AreEqual((int?) 20, list[0]); in AddRange_Optimized_NullableValueType()
133 Assert.AreEqual((int?) 30, list[1]); in AddRange_Optimized_NullableValueType()
143 Assert.Catch<ArgumentException>(() => list.AddRange(new List<string> { "foo", null })); in AddRange_Optimized_NullsProhibited_ReferenceType()
153 Assert.Catch<ArgumentException>(() => list.AddRange(new List<int?> { 20, null })); in AddRange_Optimized_NullsProhibited_NullableValueType()
169 Assert.AreEqual(3, list.Count); in AddRange_RepeatedField()
170 Assert.AreEqual("original", list[0]); in AddRange_RepeatedField()
171 Assert.AreEqual("foo", list[1]); in AddRange_RepeatedField()
172 Assert.AreEqual("bar", list[2]); in AddRange_RepeatedField()
184 Assert.AreEqual(0, list.Count); in RemoveAt_Valid()
191 Assert.Throws<ArgumentOutOfRangeException>(() => list.RemoveAt(-1)); in RemoveAt_Invalid()
192 Assert.Throws<ArgumentOutOfRangeException>(() => list.RemoveAt(3)); in RemoveAt_Invalid()
211 Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(-1, "foo")); in Insert_Invalid()
212 Assert.Throws<ArgumentOutOfRangeException>(() => list.Insert(3, "foo")); in Insert_Invalid()
213 Assert.Throws<ArgumentNullException>(() => list.Insert(0, null)); in Insert_Invalid()
220 Assert.IsFalse(list.Equals((RepeatedField<string>) null)); in Equals_RepeatedField()
221 Assert.IsTrue(list.Equals(list)); in Equals_RepeatedField()
222 Assert.IsFalse(list.Equals(new RepeatedField<string> { "first", "third" })); in Equals_RepeatedField()
223 Assert.IsFalse(list.Equals(new RepeatedField<string> { "first" })); in Equals_RepeatedField()
224 Assert.IsTrue(list.Equals(new RepeatedField<string> { "first", "second" })); in Equals_RepeatedField()
231 Assert.IsFalse(list.Equals((object) null)); in Equals_Object()
232 Assert.IsTrue(list.Equals((object) list)); in Equals_Object()
233 Assert.IsFalse(list.Equals((object) new RepeatedField<string> { "first", "third" })); in Equals_Object()
234 Assert.IsFalse(list.Equals((object) new RepeatedField<string> { "first" })); in Equals_Object()
235 Assert.IsTrue(list.Equals((object) new RepeatedField<string> { "first", "second" })); in Equals_Object()
236 Assert.IsFalse(list.Equals(new object())); in Equals_Object()
267 Assert.AreEqual("first", list[0]); in Indexer_Get()
268 Assert.AreEqual("second", list[1]); in Indexer_Get()
269 Assert.Throws<ArgumentOutOfRangeException>(() => list[-1].GetHashCode()); in Indexer_Get()
270 Assert.Throws<ArgumentOutOfRangeException>(() => list[2].GetHashCode()); in Indexer_Get()
278 Assert.AreEqual("changed", list[0]); in Indexer_Set()
279 Assert.Throws<ArgumentNullException>(() => list[0] = null); in Indexer_Set()
280 Assert.Throws<ArgumentOutOfRangeException>(() => list[-1] = "bad"); in Indexer_Set()
281 Assert.Throws<ArgumentOutOfRangeException>(() => list[2] = "bad"); in Indexer_Set()
298 Assert.IsTrue(enumerator.MoveNext()); in Enumerator()
299 Assert.AreEqual("first", enumerator.Current); in Enumerator()
300 Assert.IsTrue(enumerator.MoveNext()); in Enumerator()
301 Assert.AreEqual("second", enumerator.Current); in Enumerator()
302 Assert.IsFalse(enumerator.MoveNext()); in Enumerator()
303 Assert.IsFalse(enumerator.MoveNext()); in Enumerator()
332 Assert.IsTrue(input.IsAtEnd); in AddEntriesFrom_PackedInt32()
358 Assert.IsTrue(input.IsAtEnd); in AddEntriesFrom_NonPackedInt32()
381 Assert.IsTrue(input.IsAtEnd); in AddEntriesFrom_String()
405 Assert.IsTrue(input.IsAtEnd); in AddEntriesFrom_Message()
422 Assert.AreEqual(10, input.ReadInt32()); in WriteTo_PackedInt32()
423 Assert.AreEqual(1000, input.ReadInt32()); in WriteTo_PackedInt32()
424 Assert.AreEqual(1000000, input.ReadInt32()); in WriteTo_PackedInt32()
425 Assert.IsTrue(input.IsAtEnd); in WriteTo_PackedInt32()
426Assert.AreEqual(1 + CodedOutputStream.ComputeLengthSize(length) + length, stream.Length); in WriteTo_PackedInt32()
442 Assert.AreEqual(10, input.ReadInt32()); in WriteTo_NonPackedInt32()
444 Assert.AreEqual(1000, input.ReadInt32()); in WriteTo_NonPackedInt32()
446 Assert.AreEqual(1000000, input.ReadInt32()); in WriteTo_NonPackedInt32()
447 Assert.IsTrue(input.IsAtEnd); in WriteTo_NonPackedInt32()
463 Assert.AreEqual("Foo", input.ReadString()); in WriteTo_String()
465 Assert.AreEqual("", input.ReadString()); in WriteTo_String()
467 Assert.AreEqual("Bar", input.ReadString()); in WriteTo_String()
468 Assert.IsTrue(input.IsAtEnd); in WriteTo_String()
486 Assert.AreEqual(message1, input.ReadMessage(ForeignMessage.Parser)); in WriteTo_Message()
488 Assert.AreEqual(message2, input.ReadMessage(ForeignMessage.Parser)); in WriteTo_Message()
489 Assert.IsTrue(input.IsAtEnd); in WriteTo_Message()
498 Assert.AreEqual(7, list.CalculateSize(FieldCodec.ForInt32(tag))); in CalculateSize_VariableSizeNonPacked()
507 Assert.AreEqual(15, list.CalculateSize(FieldCodec.ForSFixed32(tag))); in CalculateSize_FixedSizeNonPacked()
517 Assert.AreEqual(6, list.CalculateSize(FieldCodec.ForInt32(tag))); in CalculateSize_VariableSizePacked()
526 Assert.AreEqual(14, list.CalculateSize(FieldCodec.ForSFixed32(tag))); in CalculateSize_FixedSizePacked()
543 Assert.AreEqual(0, output.SpaceLeft); in TestNegativeEnumArray()
551 Assert.AreEqual(6, values.Count); in TestNegativeEnumArray()
552 Assert.AreEqual(SampleEnum.None, values[0]); in TestNegativeEnumArray()
553 Assert.AreEqual(((SampleEnum)(-1)), values[1]); in TestNegativeEnumArray()
554 Assert.AreEqual(SampleEnum.NegativeValue, values[2]); in TestNegativeEnumArray()
555 Assert.AreEqual(((SampleEnum)(-3)), values[3]); in TestNegativeEnumArray()
556 Assert.AreEqual(((SampleEnum)(-4)), values[4]); in TestNegativeEnumArray()
557 Assert.AreEqual(((SampleEnum)(-5)), values[5]); in TestNegativeEnumArray()
581 Assert.AreEqual(0, output.SpaceLeft); in TestNegativeEnumPackedArray()
589 Assert.AreEqual(6, values.Count); in TestNegativeEnumPackedArray()
590 Assert.AreEqual(SampleEnum.None, values[0]); in TestNegativeEnumPackedArray()
591 Assert.AreEqual(((SampleEnum)(-1)), values[1]); in TestNegativeEnumPackedArray()
592 Assert.AreEqual(SampleEnum.NegativeValue, values[2]); in TestNegativeEnumPackedArray()
593 Assert.AreEqual(((SampleEnum)(-3)), values[3]); in TestNegativeEnumPackedArray()
594 Assert.AreEqual(((SampleEnum)(-4)), values[4]); in TestNegativeEnumPackedArray()
595 Assert.AreEqual(((SampleEnum)(-5)), values[5]); in TestNegativeEnumPackedArray()
618 Assert.Throws<InvalidProtocolBufferException>(() => field.AddEntriesFrom(input, codec)); in TestPackedRepeatedFieldCollectionNonDivisibleLength()
621 Assert.AreEqual(0, field.Count); in TestPackedRepeatedFieldCollectionNonDivisibleLength()
645 Assert.Throws<InvalidProtocolBufferException>(() => field.AddEntriesFrom(input, codec)); in TestPackedRepeatedFieldCollectionNotAllocatedWhenLengthExceedsBuffer()
648 Assert.AreEqual(0, field.Count); in TestPackedRepeatedFieldCollectionNotAllocatedWhenLengthExceedsBuffer()
677 Assert.Fail(); in TestPackedRepeatedFieldCollectionNotAllocatedWhenLengthExceedsRemainingData()
684 Assert.AreEqual(0, field.Count); in TestPackedRepeatedFieldCollectionNotAllocatedWhenLengthExceedsRemainingData()
693 Assert.AreEqual("first", list[0]); in IList_Indexer()
695 Assert.AreEqual("changed", field[1]); in IList_Indexer()
702 Assert.IsTrue(list.Contains("second")); in IList_Contains()
703 Assert.IsFalse(list.Contains("third")); in IList_Contains()
704 Assert.IsFalse(list.Contains(new object())); in IList_Contains()
730 Assert.IsFalse(list.IsFixedSize); in IList_IsFixedSize()
737 Assert.AreEqual(1, list.IndexOf("second")); in IList_IndexOf()
738 Assert.AreEqual(-1, list.IndexOf("third")); in IList_IndexOf()
739 Assert.AreEqual(-1, list.IndexOf(new object())); in IList_IndexOf()
746 Assert.AreSame(list, list.SyncRoot); in IList_SyncRoot()
761 Assert.Throws<ArrayTypeMismatchException>(() => list.CopyTo(new StringBuilder[4], 1)); in IList_CopyTo()
762 Assert.Throws<ArrayTypeMismatchException>(() => list.CopyTo(new int[4], 1)); in IList_CopyTo()
769 Assert.IsFalse(list.IsSynchronized); in IList_IsSynchronized()
785 Assert.AreEqual("[ 5, 10, 20 ]", text); in ToString_Integers()
793 Assert.AreEqual("[ \"x\", \"y\", \"z\" ]", text); in ToString_Strings()
801 Assert.AreEqual("[ { \"singleDouble\": 1.5 }, { \"singleInt32\": 10 } ]", text); in ToString_Messages()
809 Assert.AreEqual("[ ]", text); in ToString_Empty()
816 Assert.Throws<ArgumentException>(() => list.ToString()); in ToString_InvalidElementType()
824 Assert.AreEqual("[ \"2015-10-01T12:34:56Z\" ]", text); in ToString_Timestamp()
833 Assert.AreEqual(text, "[ { \"foo\": 20 } ]", message.ToString()); in ToString_Struct()
846 Assert.True(list1.Contains(SampleNaNs.SignallingFlipped)); in NaNValuesComparedBitwise()
847 Assert.False(list2.Contains(SampleNaNs.SignallingFlipped)); in NaNValuesComparedBitwise()
857 Assert.AreEqual(8, list.Capacity); in Capacity_Increase()
858 Assert.AreEqual(3, list.Count); in Capacity_Increase()
861 Assert.AreEqual(10, list.Capacity, "Capacity increased"); in Capacity_Increase()
862 Assert.AreEqual(3, list.Count); in Capacity_Increase()
872 Assert.AreEqual(8, list.Capacity); in Capacity_Decrease()
873Assert.DoesNotThrow(() => list.Capacity = 5, "Can decrease capacity if new capacity is greater tha… in Capacity_Decrease()
874 Assert.AreEqual(5, list.Capacity); in Capacity_Decrease()
876 Assert.DoesNotThrow(() => list.Capacity = 3, "Can set capacity exactly to list.Count" ); in Capacity_Decrease()
878Assert.Throws<ArgumentOutOfRangeException>(() => list.Capacity = 2, "Can't set the capacity smalle… in Capacity_Decrease()
880Assert.Throws<ArgumentOutOfRangeException>(() => list.Capacity = 0, "Can't set the capacity to zer… in Capacity_Decrease()
882Assert.Throws<ArgumentOutOfRangeException>(() => list.Capacity = -1, "Can't set the capacity to ne… in Capacity_Decrease()
890 Assert.AreEqual(0, list.Count); in Capacity_Zero()
891 Assert.AreEqual(8, list.Capacity); in Capacity_Zero()
893 Assert.DoesNotThrow(() => list.Capacity = 0, "Can set Capacity to 0"); in Capacity_Zero()
894 Assert.AreEqual(0, list.Capacity); in Capacity_Zero()