-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed type resolution issue with conflicting member name having the...
... same name as a type in its containing namespace. * Adding sample code. * Fixed issue where type resolution failed with member of same name as a type in same namespace.
- Loading branch information
Mike-EEE
authored
Jan 18, 2020
1 parent
9a5b3a9
commit 057934d
Showing
7 changed files
with
105 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
test/ExtendedXmlSerializer.Tests.ReportedIssues/Issue352Tests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using ExtendedXmlSerializer.Configuration; | ||
using ExtendedXmlSerializer.Tests.ReportedIssues.Shared; | ||
using ExtendedXmlSerializer.Tests.ReportedIssues.Support; | ||
using FluentAssertions; | ||
using Xunit; | ||
|
||
// ReSharper disable All | ||
|
||
namespace ExtendedXmlSerializer.Tests.ReportedIssues | ||
{ | ||
public sealed class Issue352Tests | ||
{ | ||
[Fact] | ||
void Verify() | ||
{ | ||
var instance = new Worker(); | ||
var cycled = new ConfigurationContainer().Create() | ||
.ForTesting() | ||
.Cycle(instance); | ||
|
||
cycled.Should().BeEquivalentTo(instance); | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
test/ExtendedXmlSerializer.Tests.ReportedIssues/Shared/Inspections.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Xml.Serialization; | ||
|
||
namespace ExtendedXmlSerializer.Tests.ReportedIssues.Shared | ||
{ | ||
[Serializable] | ||
[XmlType(AnonymousType = true, Namespace = "http://namespace/file.xsd")] | ||
[XmlRoot(ElementName = "FooBar", IsNullable = false)] | ||
public class Foo : IFoo | ||
{ | ||
[XmlElement("num")] | ||
public int Number { get; set; } | ||
} | ||
|
||
public interface IFoo {} | ||
|
||
[Serializable, XmlType(AnonymousType = true, Namespace = "http://namespace/file.xsd"), | ||
XmlRoot("myMessage", Namespace = "http://namespace/file.xsd", IsNullable = false)] | ||
public class MyMessage | ||
{ | ||
/// <remarks /> | ||
[XmlElement("myElement")] | ||
public MyElementType MyElement { get; set; } | ||
} | ||
|
||
/// <remarks /> | ||
[XmlType(Namespace = "http://namespace/file.xsd")] | ||
public class MyElementType | ||
{ | ||
/// <remarks /> | ||
[XmlAttribute("uniqueId")] | ||
public string UniqueId { get; set; } | ||
} | ||
|
||
[XmlType(Namespace = "")] | ||
public class None | ||
{ | ||
/// <remarks /> | ||
[XmlAttribute("uniqueId")] | ||
public string UniqueId { get; set; } | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
test/ExtendedXmlSerializer.Tests.ReportedIssues/Shared/Worker.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace ExtendedXmlSerializer.Tests.ReportedIssues.Shared | ||
{ | ||
class Backend {} | ||
|
||
class WorkerBackend {} | ||
|
||
class Worker | ||
{ | ||
public string Name { get; set; } = "worker"; | ||
public WorkerBackend Backend { get; set; } = new WorkerBackend(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters