public void Should_GetLoopProtectionReferencesStackCount_BeNull_BeforeAndAfterEnteringRootScope_When_RootModelReference_IsNull(string id, Specification <TraversingTestCases.TestClassA> rootSpecification, TraversingTestCases.TestClassA model) { _ = id; var modelScheme = ModelSchemeFactory.Create(rootSpecification); var context = new IsValidValidationContext(modelScheme, default); context.GetLoopProtectionReferencesStackCount().Should().BeNull(); context.EnterScope(modelScheme.RootSpecificationScopeId, model); context.GetLoopProtectionReferencesStackCount().Should().BeNull(); }
public void Should_GetLoopProtectionReferencesStackCount_BeOne_BeforeAndAfterEnteringRootScope_When_RootModelReference_Exists(string id, Specification <TraversingTestCases.TestClassA> rootSpecification, TraversingTestCases.TestClassA model) { _ = id; var modelScheme = ModelSchemeFactory.Create(rootSpecification); var context = new IsValidValidationContext(modelScheme, new ReferenceLoopProtectionSettings(new object())); context.GetLoopProtectionReferencesStackCount().Should().Be(1); context.EnterScope(modelScheme.RootSpecificationScopeId, model); context.GetLoopProtectionReferencesStackCount().Should().Be(1); }