Skip to content

Commit

Permalink
Merge branch 'hotfix-5.2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanFeldman committed Aug 4, 2015
2 parents 73e949e + b27e0b7 commit 087d5ef
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,41 @@ private bool PropertyContainsAttribute(string propertyName, Type attributeType,
{
return obj.GetType().GetProperty(propertyName).GetCustomAttributes(attributeType,true).Length > 0;
}
}

[Test]
public void Should_map_when_deriving_from_another_interface_with_the_same_property_name_but_different_type()
{
var mapper = new MessageMapper();
var genericInterfaceType = typeof(InterfaceWithGenericProperty<IBar>);
mapper.Initialize(new[] { genericInterfaceType });
Assert.NotNull(mapper.GetMappedTypeFor(genericInterfaceType));
}

public interface InterfaceWithGenericProperty
{
object Original { get; set; }
}

public interface InterfaceWithGenericProperty<T> : InterfaceWithGenericProperty
{
new T Original { get; set; }
}

public interface IBar
{
string Yeah { get; set; }
}

public class FancyMessage : InterfaceWithGenericProperty<IBar>
{
public IBar Original { get; set; }


object InterfaceWithGenericProperty.Original
{
get { return Original; }
set { Original = (IBar)value; }
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void Run(Configure config)
statusText.Append("Deactivation reason: ");
if (diagnosticData.PrerequisiteStatus != null && !diagnosticData.PrerequisiteStatus.IsSatisfied)
{
statusText.AppendLine(string.Format("Did not fulfill its Prerequisites:"));
statusText.AppendLine("Did not fulfill its Prerequisites:");

foreach (var reason in diagnosticData.PrerequisiteStatus.Reasons)
{
Expand Down
2 changes: 1 addition & 1 deletion src/NServiceBus.Core/Licensing/LicenseExpiredForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void browseButton_Click(object sender, EventArgs e)

if (LicenseExpirationChecker.HasLicenseExpired(license))
{
var message = string.Format("The license you provided has expired, please select another file.");
var message = "The license you provided has expired, please select another file.";
Logger.Warn(message);
MessageBox.Show(this, message, "License expired", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,18 @@ static IEnumerable<PropertyInfo> GetAllProperties(Type type)
props.AddRange(GetAllProperties(interfaceType));
}

var names = new List<string>(props.Count);
var names = new List<PropertyInfo>(props.Count);
var duplicates = new List<PropertyInfo>(props.Count);
foreach (var p in props)
{
if (names.Contains(p.Name))
var duplicate = names.SingleOrDefault(n => n.Name == p.Name && n.PropertyType == p.PropertyType);
if (duplicate != null)
{
duplicates.Add(p);
}
else
{
names.Add(p.Name);
names.Add(p);
}
}

Expand Down

0 comments on commit 087d5ef

Please sign in to comment.