public void ConstructorShouldSetScopeId() { var scopes = new ParsingScopes(_lifeTimeEventHandler); var scope = new ParsingScope(scopes, RangeAddress.Empty); var dependency = new FormulaDependency(scope); Assert.AreEqual(scope.ScopeId, dependency.ScopeId); }
public ParsingScope(ParsingScopes parsingScopes, ParsingScope parent, RangeAddress address) { _parsingScopes = parsingScopes; Parent = parent; Address = address; ScopeId = Guid.NewGuid(); }
public void Setup() { var provider = MockRepository.GenerateStub<ExcelDataProvider>(); _factory = new RangeAddressFactory(provider); _lifeTimeEventHandler = MockRepository.GenerateStub<IParsingLifetimeEventHandler>(); _parsingScopes = MockRepository.GenerateStub<ParsingScopes>(_lifeTimeEventHandler); }
public ParsingScope(ParsingScopes parsingScopes, ParsingScope parent, RangeAddress address) { _parsingScopes = parsingScopes; Parent = parent; Address = address; ScopeId = Guid.NewGuid(); }
public void ConstructorShouldSetAddress() { var scopes = new ParsingScopes(_lifeTimeEventHandler); var expectedAddress = _factory.Create("A1"); var scope = new ParsingScope(scopes, expectedAddress); var dependency = new FormulaDependency(scope); Assert.AreEqual(expectedAddress, dependency.Address); }
public void Setup() { var provider = MockRepository.GenerateStub<ExcelDataProvider>(); _factory = new RangeAddressFactory(provider); _lifetimeEventHandler = MockRepository.GenerateStub<IParsingLifetimeEventHandler>(); _scopes = MockRepository.GenerateStub<ParsingScopes>(_lifetimeEventHandler); _formulaDependencyFactory = MockRepository.GenerateStub<FormulaDependencyFactory>(); _formulaDependencies = new FormulaDependencies(_formulaDependencyFactory); }
public void ShouldThrowWhenCircularReferenceIsDetectedWhenReferenceByIsAdded() { var lifetimeMock = MockRepository.GenerateStub<IParsingLifetimeEventHandler>(); var scopes = new ParsingScopes(lifetimeMock); var scope1 = scopes.NewScope(_factory.Create("A1")); var scope2 = scopes.NewScope(_factory.Create("A2")); var formulaDependency = new FormulaDependency(scope1); formulaDependency.AddReferenceTo(scope2.Address); formulaDependency.AddReferenceFrom(scope2.Address); }
public void Setup() { _lifeTimeEventHandler = MockRepository.GenerateStub<IParsingLifetimeEventHandler>(); _parsingScopes = new ParsingScopes(_lifeTimeEventHandler); }
public ParsingScope(ParsingScopes parsingScopes, RangeAddress address) : this(parsingScopes, null, address) { }
public ParsingScope(ParsingScopes parsingScopes, RangeAddress address) : this(parsingScopes, null, address) { }