When a:
* Shared part
* Involved in a circular dependency
* Has more than one export
Then the part should be created only once but is instantiated twice.
Found in version 1.0.16.
Failing test case below.
```
[Shared, Export, Export("named")]
public class TwoExports
{
[Import]
public CircularImporter Importer { get; set; }
}
[Shared, Export]
public class CircularImporter
{
[Import]
public TwoExports TwoExports { get; set; }
}
[TestMethod]
public void SharedPartWithManyExportsInCircularityCreatedOnce()
{
var container = new ContainerConfiguration()
.WithPart<TwoExports>()
.WithPart<CircularImporter>()
.CreateContainer();
var a = container.GetExport<TwoExports>("named");
var b = container.GetExport<TwoExports>();
Assert.AreSame(a, b);
}
```
* Shared part
* Involved in a circular dependency
* Has more than one export
Then the part should be created only once but is instantiated twice.
Found in version 1.0.16.
Failing test case below.
```
[Shared, Export, Export("named")]
public class TwoExports
{
[Import]
public CircularImporter Importer { get; set; }
}
[Shared, Export]
public class CircularImporter
{
[Import]
public TwoExports TwoExports { get; set; }
}
[TestMethod]
public void SharedPartWithManyExportsInCircularityCreatedOnce()
{
var container = new ContainerConfiguration()
.WithPart<TwoExports>()
.WithPart<CircularImporter>()
.CreateContainer();
var a = container.GetExport<TwoExports>("named");
var b = container.GetExport<TwoExports>();
Assert.AreSame(a, b);
}
```