Ejemplo n.º 1
0
		public void CanInsert_IntoCollection()
		{
			DetailCollection collection = new DetailCollection();
			collection.Insert(0, "hello");
			collection.Insert(0, "world");

			Assert.That(collection.IndexOf("hello"), Is.EqualTo(1));
			Assert.That(collection.IndexOf("world"), Is.EqualTo(0));
		}
Ejemplo n.º 2
0
		public void CanFind_IndexOfInteger()
		{
			DetailCollection collection = new DetailCollection();
			collection.Add(1);
			collection.Add(2);

			Assert.That(collection.IndexOf(1), Is.EqualTo(0));
			Assert.That(collection.IndexOf(2), Is.EqualTo(1));
		}
Ejemplo n.º 3
0
        public void CanFind_IndexOfString()
        {
            DetailCollection collection = new DetailCollection();

            collection.Add("hello");
            collection.Add("world");

            Assert.That(collection.IndexOf("hello"), Is.EqualTo(0));
            Assert.That(collection.IndexOf("world"), Is.EqualTo(1));
        }
Ejemplo n.º 4
0
        public void CanInsert_IntoCollection()
        {
            DetailCollection collection = new DetailCollection();

            collection.Insert(0, "hello");
            collection.Insert(0, "world");

            Assert.That(collection.IndexOf("hello"), Is.EqualTo(1));
            Assert.That(collection.IndexOf("world"), Is.EqualTo(0));
        }
Ejemplo n.º 5
0
        public void CanFind_IndexOfInteger()
        {
            DetailCollection collection = new DetailCollection();

            collection.Add(1);
            collection.Add(2);

            Assert.That(collection.IndexOf(1), Is.EqualTo(0));
            Assert.That(collection.IndexOf(2), Is.EqualTo(1));
        }
Ejemplo n.º 6
0
        public void DoesntThrow_WhenCollection_ContainsNullValue()
        {
            DetailCollection collection = new DetailCollection();

            collection.Details.Add(new ContentDetail());

            Assert.That(collection.IndexOf("something"), Is.EqualTo(-1));
        }
Ejemplo n.º 7
0
        public void IndexOf_NotFoundItem_IsNegativeOne()
        {
            DetailCollection collection = new DetailCollection();

            collection.Add("hello");
            collection.Add("world");

            Assert.That(collection.IndexOf("sweden"), Is.EqualTo(-1));
        }
Ejemplo n.º 8
0
		public void CanFind_IndexOfString()
		{
			DetailCollection collection = new DetailCollection();
			collection.Add("hello");
			collection.Add("world");

			Assert.That(collection.IndexOf("hello"), Is.EqualTo(0));
			Assert.That(collection.IndexOf("world"), Is.EqualTo(1));
		}
Ejemplo n.º 9
0
		public void DoesntThrow_WhenCollection_ContainsNullValue()
		{
			DetailCollection collection = new DetailCollection();
			collection.Details.Add(new ContentDetail());

			Assert.That(collection.IndexOf("something"), Is.EqualTo(-1));
		}
Ejemplo n.º 10
0
		public void IndexOf_NotFoundItem_IsNegativeOne()
		{
			DetailCollection collection = new DetailCollection();
			collection.Add("hello");
			collection.Add("world");

			Assert.That(collection.IndexOf("sweden"), Is.EqualTo(-1));
		}