Beispiel #1
0
        public void ShouldReturnNullIfEmpty()
        {
            //arrange
            var set = new TypedSet <FooBase>();

            //act
            var returnedItem = set.Get <Foo1>();

            //assert
            Assert.AreEqual(null, returnedItem);
        }
Beispiel #2
0
        public void ShouldReturnNullIfDoesNotContain()
        {
            //arrange
            var set = new TypedSet <FooBase>();

            set.Insert(new Foo1());
            set.Insert(new Foo2());

            //act
            var returnedItem = set.Get <Foo3>();

            //assert
            Assert.AreEqual(null, returnedItem);
        }
Beispiel #3
0
        public void ShouldReturnItemOfDesiredTypeIfContains()
        {
            //arrange
            var set         = new TypedSet <FooBase>();
            var desiredItem = new Foo3();

            set.Insert(new Foo1());
            set.Insert(new Foo2());
            set.Insert(desiredItem);

            //act
            var returnedItem = set.Get <Foo3>();

            //assert
            Assert.AreEqual(desiredItem, returnedItem);
        }