public void GetShouldReturnCommandLineArgumentsAttribute() { var attribute = CommandLineArgumentsAttribute.Get(typeof(XCopyCommandArgs)); Assert.IsNotNull(attribute); Assert.AreEqual(XCopyCommandArgs.Title, attribute.Title); Assert.AreEqual(XCopyCommandArgs.Description, attribute.Description); }
public void SettingDescriptionResourceIdAndDescriptionThrows() { var attribute = new CommandLineArgumentsAttribute() { DescriptionResourceId = "foo" }; Assert.Equal(Strings.AmbiguousAttributeValues("Description", "DescriptionResourceId"), Assert.Throws<InvalidOperationException>(() => attribute.Description = "bar").Message); }
public void SettingTitleResourceIdAndTitleThrows() { var attribute = new CommandLineArgumentsAttribute() { TitleResourceId = "foo" }; Assert.Equal(Strings.AmbiguousAttributeValues("Title", "TitleResourceId"), Assert.Throws<InvalidOperationException>(() => attribute.Title = "bar").Message); }
public void GetThrowsArgumentNullWhenNull() { CommandLineArgumentsAttribute.Get(null); }
public void GetReturnsNullWhenNoAttribute() { var attribute = CommandLineArgumentsAttribute.Get(typeof(string)); Assert.IsNull(attribute); }