Ejemplo n.º 1
0
        public void InstancesWithDuplicateTypes()
        {
            var collection = new IInterface[] { new A(), new B(), new A() };

            var result = collection.IsContainingInstancesOfDifferentTypes();

            result.Should().BeFalse();
        }
Ejemplo n.º 2
0
        public void ItemNull()
        {
            var collection = new IInterface[] { new A(), null, new C() };

            Action act = () => collection.IsContainingInstancesOfDifferentTypes();

            act.Should().Throw <CollectionException>()
            .And.Message.Should().Contain($"The collection contains null at index 1");
        }