Example #1
0
        public void GetSourcesReturnOneElementArrayForSingleSource()
        {
            var metadata = new ConverterMetadata {
                InternalSources = typeof(int),
            };

            Type[] sources = metadata.GetSources();
            Assert.That(sources.Length, Is.EqualTo(1));
            Assert.That(sources[0], Is.EqualTo(typeof(int)));
        }
Example #2
0
        public void GetSourcesReturnTwoElementsArrayForListOfSources()
        {
            var metadata = new ConverterMetadata {
                InternalSources = new Type[] { typeof(int), typeof(string) },
            };

            Type[] sources = metadata.GetSources();
            Assert.That(sources.Length, Is.EqualTo(2));
            Assert.That(sources[0], Is.EqualTo(typeof(int)));
            Assert.That(sources[1], Is.EqualTo(typeof(string)));
        }
Example #3
0
        public void GetSourcesReturnEmptyArrayForDefaultValue()
        {
            var metadata = new ConverterMetadata();

            Assert.That(metadata.GetSources(), Is.Empty);
        }