private static void ProcessConstructors(CheckOptions checkOptions, ConstructorInfo[] constructors, int constructorsCount, TypeDto typeDto)
        {
            for (int n = 0; n < constructorsCount; n++)
            {
                var cInfo = constructors[n];

                var cDto = new ConstructorDto {
                    Name = cInfo.ToString()
                };
                typeDto.Constructors.Add(cDto);

                if (!checkOptions.LogOnlyMissing)
                {
                    Log.Write(Verbosity.Normal, LogLevel.Information, "    Processing constructor {0} of {1}", n + 1, constructorsCount);
                }

                var constructorXml = DocsService.GetXmlForConstructor(cInfo, false);
                cDto.XmlDescription = GetInnerText(constructorXml);

                if (string.IsNullOrEmpty(cDto.XmlDescription) && cInfo.GetParameters().Count() == 0)
                {
                    cDto.XmlDescription = "Default constructor is allowed to have empty summary description";
                }

                if (string.IsNullOrEmpty(cDto.XmlDescription))
                {
                    Log.Write(Verbosity.Normal, LogLevel.Warning, "    CONSTRUCTOR: {0} {1} XML: {2}", typeDto.Name, cDto.Name, MISSING_XML);
                }
                else if (!checkOptions.LogOnlyMissing)
                {
                    Log.Write(Verbosity.Normal, LogLevel.Information, "    CONSTRUCTOR: {0} {1} XML: {2}", typeDto.Name, cDto.Name, cDto.XmlDescription);
                }
            }
        }
示例#2
0
        public void GenerationThroughConstructor()
        {
            var o1    = new ConstructorDto();
            var value = _faker.Create <ConstructorDto>();

            Assert.AreNotEqual(01, value);
        }
示例#3
0
        public void GenerationDtoWithDto()
        {
            var o1    = new ConstructorDto();
            var value = _faker.Create <DtoWithInnerDto>();

            Assert.AreNotEqual(null, value._constructorDto);
            Assert.AreNotEqual(01, value._constructorDto);
        }