예제 #1
0
        public void ReturnsCorrectTypes()
        {
            // Arrange
            var typesArray = new[]
            {
                typeof(string),
                typeof(FakeDeserializer),
                typeof(char),
                typeof(FakeDeserializer)
            };
            var iterator = new OpenApiDeserializerAssemblyIterator(typesArray);

            // Act
            var counter  = typesArray.Count(type => type == typeof(FakeDeserializer));
            var getTypes = new List <Type>();

            while (iterator.MoveNext())
            {
                getTypes.Add(iterator.Current);
                counter--;
            }

            // Assert
            Assert.Equal(0, counter);
            Assert.True(getTypes.All(type => type == typeof(FakeDeserializer)), "Iterator returns incorrect type.");
        }
예제 #2
0
        public void ReturnsNothingOnNullCollection()
        {
            // Act
            var iterator = new OpenApiDeserializerAssemblyIterator(null);

            // Assert
            Assert.False(iterator.MoveNext(), "Collection should be empty");
        }
예제 #3
0
        public void ReturnsNothingOnEmptyCollection()
        {
            // Arrange
            var typeArray = new Type[0];

            // Act
            var iterator = new OpenApiDeserializerAssemblyIterator(typeArray);

            // Assert
            Assert.False(iterator.MoveNext(), "Collection should be empty");
        }