Skip to content

Commit

Permalink
fix the ci
Browse files Browse the repository at this point in the history
  • Loading branch information
dadhi committed Mar 16, 2022
1 parent 35d2084 commit c67fbe6
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ public void Should_use_data_from_the_scope_when_resolving_in_scope()
container.Register<DataDependentIndirectly2>();

// now it fails even if this is removed
//var outside = container.Resolve<DataDependentIndirectly2>();
var outside = container.Resolve<DataDependentIndirectly2>();

using var scope = container.OpenScope();
scope.Use(new Data { Text = "child" });

var inScope = scope.Resolve<DataDependentIndirectly2>();
Assert.AreEqual("child", inScope.Dependent.Data1.Text); // fails, the value is "parent"
using (var scope = container.OpenScope())
{
scope.Use(new Data { Text = "child" });
var inScope = scope.Resolve<DataDependentIndirectly2>();
Assert.AreEqual("child", inScope.Dependent.Data1.Text); // fails, the value is "parent"
}
}

[Test]
Expand All @@ -106,11 +107,12 @@ public void Should_use_data_from_the_scope_when_resolving_in_scope_without_the_f
container.Register<IDataDependent, DataDependent>();
container.Register<DataDependentIndirectly2>();

using var scope = container.OpenScope();
scope.Use(new Data { Text = "child" });

var inScope = scope.Resolve<DataDependentIndirectly2>();
Assert.AreEqual("child", inScope.Dependent.Data1.Text); // fails, the value is "parent"
using (var scope = container.OpenScope())
{
scope.Use(new Data { Text = "child" });
var inScope = scope.Resolve<DataDependentIndirectly2>();
Assert.AreEqual("child", inScope.Dependent.Data1.Text); // fails, the value is "parent"
}
}

public class Data
Expand Down

0 comments on commit c67fbe6

Please sign in to comment.