コード例 #1
0
        public void LocalizedArgumentAttributeMustSupplyResourceType()
        {
            var attribute = new CommandLineArgumentAttribute(CommandLineArgumentFlags.AtMostOnce);

            attribute.Description = "#Description";
            var desc = attribute.LocalizedDescription;
        }
コード例 #2
0
        public void UnLocalizedNullArgumentAttributeReturnsNull()
        {
            var attribute = new CommandLineArgumentAttribute(CommandLineArgumentFlags.AtMostOnce);

            attribute.Description = null;
            Assert.AreEqual(null, attribute.Description);
        }
コード例 #3
0
        public void UnLocalizedArgumentAttributeDoesNotNeedResource()
        {
            var attribute = new CommandLineArgumentAttribute(CommandLineArgumentFlags.AtMostOnce);

            attribute.LongName = "no-logo";
            Assert.AreEqual("no-logo", attribute.LongName);
        }
コード例 #4
0
        public void LocalizedArgumentAttributeMustFindStringResourceNamed()
        {
            var attribute = new CommandLineArgumentAttribute(CommandLineArgumentFlags.AtMostOnce);

            attribute.ResourceType = typeof(Gallio.Tests.Properties.Resources);
            attribute.Description  = "#CommandLineArgumentAttributeTests_NotAStringResource";
            var desc = attribute.LocalizedDescription;
        }
コード例 #5
0
        public void LocalizedArgumentAttributeDescription()
        {
            var attribute = new CommandLineArgumentAttribute(CommandLineArgumentFlags.AtMostOnce);

            attribute.Description  = "#CommandLineArgumentAttributeTests_Description";
            attribute.ResourceType = typeof(Gallio.Tests.Properties.Resources);
            Assert.AreEqual("#CommandLineArgumentAttributeTests_Description", attribute.Description);
            Assert.AreEqual("Description", attribute.LocalizedDescription);
        }
コード例 #6
0
        public void LocalizedArgumentAttributeLongName()
        {
            var attribute = new CommandLineArgumentAttribute(CommandLineArgumentFlags.AtMostOnce);

            attribute.LongName     = "#CommandLineArgumentAttributeTests_LongName";
            attribute.ResourceType = typeof(Gallio.Tests.Properties.Resources);
            Assert.AreEqual("#CommandLineArgumentAttributeTests_LongName", attribute.LongName);
            Assert.AreEqual("Long name", attribute.LocalizedLongName);
        }
コード例 #7
0
        public void LocalizedArgumentAttributeOneSynonym()
        {
            var attribute = new CommandLineArgumentAttribute(CommandLineArgumentFlags.AtMostOnce);

            attribute.Synonyms     = new [] { "#CommandLineArgumentAttributeTests_Synonym1" };
            attribute.ResourceType = typeof(Gallio.Tests.Properties.Resources);
            Assert.AreEqual("#CommandLineArgumentAttributeTests_Synonym1", attribute.Synonyms[0]);
            Assert.AreEqual("Synonym1", attribute.LocalizedSynonyms[0]);
        }
コード例 #8
0
        public void LocalizedArgumentAttributeValueLabel()
        {
            var attribute = new CommandLineArgumentAttribute(CommandLineArgumentFlags.AtMostOnce);

            attribute.ValueLabel   = "#CommandLineArgumentAttributeTests_ValueLabel";
            attribute.ResourceType = typeof(Gallio.Tests.Properties.Resources);
            Assert.AreEqual("#CommandLineArgumentAttributeTests_ValueLabel", attribute.ValueLabel);
            Assert.AreEqual("Value label", attribute.LocalizedValueLabel);
        }