public void MainTest(Domain domain) { var isRecreate = domain.Configuration.UpgradeMode == DomainUpgradeMode.Recreate; var domainModel = domain.Model; var defaultNode = domain.StorageNodeManager.GetNode(WellKnown.DefaultNodeId); var additionalNode = domain.StorageNodeManager.GetNode(FirstSchema) ?? domain.StorageNodeManager.GetNode(SecondSchema); var additionalNodeSchema = additionalNode.Id; var defaultNodeSchema = additionalNode.Id == FirstSchema ? SecondSchema : FirstSchema; if (!isRecreate) { Assert.That(domainModel.Types.Entities .Where(e => !e.IsSystem).All(e => e.TypeId == defaultNode.TypeIdRegistry[e]), Is.True); Assert.That(domainModel.Types.Entities .Where(e => !e.IsSystem).All(e => TypeIdentifierMapper.GetTypeId(e.UnderlyingType, defaultNodeSchema) == defaultNode.TypeIdRegistry[e])); Assert.That(domainModel.Types.Entities .Where(e => !e.IsSystem).All(e => e.TypeId != additionalNode.TypeIdRegistry[e]), Is.True); Assert.That(domainModel.Types.Entities .Where(e => !e.IsSystem).All(e => TypeIdentifierMapper.GetTypeId(e.UnderlyingType, additionalNodeSchema) == additionalNode.TypeIdRegistry[e])); } else { Assert.That(domainModel.Types.Entities.All(e => e.TypeId == defaultNode.TypeIdRegistry[e]), Is.True); Assert.That(domainModel.Types.Entities.Where(e => !e.IsSystem).All(e => defaultNode.TypeIdRegistry[e] < 300)); Assert.That(domainModel.Types.Entities.Where(e => !e.IsSystem).All(e => e.TypeId == additionalNode.TypeIdRegistry[e]), Is.True); Assert.That(domainModel.Types.Entities.Where(e => !e.IsSystem).All(e => additionalNode.TypeIdRegistry[e] < 300)); } }
private void BuildInitialDomains() { foreach (var buildInitialConfiguration in BuildInitialConfigurations()) { using (var domain = Domain.Build(buildInitialConfiguration)) { var verificationResult = domain.Model.Types.Entities .Where(e => !e.IsSystem) .All(el => el.TypeId == TypeIdentifierMapper.GetTypeId(el.UnderlyingType, buildInitialConfiguration.DefaultSchema)); Assert.That(verificationResult, Is.True); } } }