コード例 #1
0
        public void GetShouldReturnCommandLineArgumentsAttribute()
        {
            var attribute = CommandLineArgumentsAttribute.Get(typeof(XCopyCommandArgs));

            Assert.IsNotNull(attribute);
            Assert.AreEqual(XCopyCommandArgs.Title, attribute.Title);
            Assert.AreEqual(XCopyCommandArgs.Description, attribute.Description);
        }
コード例 #2
0
        public void SettingDescriptionResourceIdAndDescriptionThrows()
        {
            var attribute = new CommandLineArgumentsAttribute()
            {
                DescriptionResourceId = "foo"
            };

            Assert.Equal(Strings.AmbiguousAttributeValues("Description", "DescriptionResourceId"), Assert.Throws<InvalidOperationException>(() => attribute.Description = "bar").Message);
        }
コード例 #3
0
        public void SettingTitleResourceIdAndTitleThrows()
        {
            var attribute = new CommandLineArgumentsAttribute()
            {
                TitleResourceId = "foo"
            };

            Assert.Equal(Strings.AmbiguousAttributeValues("Title", "TitleResourceId"), Assert.Throws<InvalidOperationException>(() => attribute.Title = "bar").Message);
        }
コード例 #4
0
 public void GetThrowsArgumentNullWhenNull()
 {
     CommandLineArgumentsAttribute.Get(null);
 }
コード例 #5
0
        public void GetReturnsNullWhenNoAttribute()
        {
            var attribute = CommandLineArgumentsAttribute.Get(typeof(string));

            Assert.IsNull(attribute);
        }