public void GetEffectiveRootScope_WithNoNesting_ShouldReturnSelf() { using var scope = new ManuallyActivatedScope(1, AmbientScopeOption.NoNesting, noNestingIgnoresDefaultScope: true); scope.Activate(); var parent = scope.GetEffectiveRootScope(); Assert.Equal(scope, parent); }
public void GetEffectiveRootScope_WithJoinExistingAndNoNestingUnderlyingScope_ShouldReturnUnderlyingScope() { using var underlyingScope = new ManuallyActivatedScope(1, AmbientScopeOption.NoNesting, noNestingIgnoresDefaultScope: true); underlyingScope.Activate(); using var scope = new ManuallyActivatedScope(1, AmbientScopeOption.JoinExisting); scope.Activate(); var parent = scope.GetEffectiveRootScope(); Assert.Equal(underlyingScope, parent); }