Example #1
0
        public void TestAllColumnToolTipsAreLocalized()
        {
            var documentContainer = new MemoryDocumentContainer();

            Assert.IsTrue(documentContainer.SetDocument(new SrmDocument(SrmSettingsList.GetDefault()), documentContainer.Document));
            SkylineDataSchema skylineDataSchema = new SkylineDataSchema(documentContainer, SkylineDataSchema.GetLocalizedSchemaLocalizer());
            var missingCaptions = new HashSet <ColumnCaption>();

            foreach (var columnDescriptor in
                     EnumerateAllColumnDescriptors(skylineDataSchema, STARTING_TYPES))
            {
                var invariantDescription = skylineDataSchema.GetColumnDescription(columnDescriptor);
                if (string.IsNullOrEmpty(invariantDescription))
                {
                    var invariantCaption = skylineDataSchema.GetColumnCaption(columnDescriptor) as ColumnCaption;
                    if (invariantCaption != null)
                    {
                        missingCaptions.Add(invariantCaption);
                    }
                }
            }
            if (missingCaptions.Count == 0)
            {
                return;
            }
            StringWriter message = new StringWriter();

            WriteResXFile(message, missingCaptions);
            Assert.Fail("Missing localized tooltips for column captions: {0}", message.ToString().Replace("<data", "\r\n<data"));
        }