protected override void Context() { _report = new DiffReport(); _commonAncestor = new Container(); _settings = new ComparerSettings(); CreateSut(); }
public CompanyProfile() { Id = -1; Name = string.Empty; Street = string.Empty; City = string.Empty; State = string.Empty; Zip = string.Empty; Country = string.Empty; TaxCode = string.Empty; VatCode = string.Empty; Email = string.Empty; Web = string.Empty; Phone = string.Empty; Mobile = string.Empty; Fax = string.Empty; Note = string.Empty; ContactName = string.Empty; ContactEmail = string.Empty; ContactPhone = string.Empty; ProfileRate = new CompanyProfileRate(); ComparerOptions = new ComparerSettings(); MetricGroup = new QualityMetricGroup(); }
protected override void Context() { base.Context(); var dimension = DomainHelperForSpecs.LengthDimensionForSpecs(); var c1 = new Container { Name = "O" }; var p11 = new Parameter { Name = "P1" }.WithParentContainer(c1); p11.DisplayUnit = dimension.Units.First(); p11.Formula = new ConstantFormula(5); var c2 = new Container { Name = "O" }; var p21 = new Parameter { Name = "P1" }.WithParentContainer(c2); p21.DisplayUnit = dimension.Units.Last(); p21.Formula = new ConstantFormula(5); _object1 = c1; _object2 = c2; _comparerSettings = new ComparerSettings { FormulaComparison = FormulaComparison.Value, OnlyComputingRelevant = true }; }
protected override void Context() { base.Context(); var c1 = new Container { Name = "O" }; var p11 = new Parameter { Name = "P1" }.WithParentContainer(c1); p11.Formula = new ConstantFormula(5); p11.ValueOrigin.Description = "HELLO"; var c2 = new Container { Name = "O" }; var p21 = new Parameter { Name = "P1" }.WithParentContainer(c2); p21.Formula = new ConstantFormula(5); p21.ValueOrigin.Description = "HELLO-2"; _object1 = c1; _object2 = c2; _comparerSettings = new ComparerSettings { FormulaComparison = FormulaComparison.Value, OnlyComputingRelevant = false }; }
protected override void Context() { _settings = new ComparerSettings(); _parameter1 = DomainHelperForSpecs.ConstantParameterWithValue(visible: true); _parameter2 = DomainHelperForSpecs.ConstantParameterWithValue(visible: true); _comparison = new Comparison <IParameter>(_parameter1, _parameter2, _settings, new DiffReport(), null); }
protected override void Context() { sut = IoC.Resolve <IObjectComparer>(); _comparerSettings = new ComparerSettings { CompareHiddenEntities = true }; }
public Comparison(TObject object1, TObject object2, ComparerSettings settings, DiffReport report, object commonAncestor) { Object1 = object1; Object2 = object2; Settings = settings; Report = report; CommonAncestor = commonAncestor; }
public virtual void Compare(string dataName) { Parallel.Invoke( () => Helpers.Database.ExecuteScript(m_Version, Helpers.Database.DatabaseLocation.Source, $"{dataName}.Source.sql"), () => Helpers.Database.ExecuteScript(m_Version, Helpers.Database.DatabaseLocation.Target, $"{dataName}.Target.sql")); var settings = new ComparerSettings(m_Version); var compareResult = UpdateDatabase(settings); AssertNoDifferenceBetweenSourceAndTarget(); AssertComparerSeesNoDifference(settings); ExecuteSpecificAsserts(dataName, compareResult); }
protected override void Context() { base.Context(); _object1 = new Parameter().WithName("P1"); var parameter = new Parameter().WithName("P2"); parameter.Visible = false; _object2 = parameter; _comparerSettings = new ComparerSettings { CompareHiddenEntities = false }; }
public PresentationUserSettings() { DisplayUnits = new DisplayUnitsManager(); ComparerSettings = new ComparerSettings(); DiagramOptions = new DiagramOptions { SnapGridVisible = true }; ProjectFiles = new List <string>(); JournalPageEditorSettings = new JournalPageEditorSettings(); DefaultChartYScaling = Scalings.Log; ParameterIdentificationFeedbackEditorSettings = new ParameterIdentificationFeedbackEditorSettings(); SensitivityAnalysisFeedbackEditorSettings = new SensitivityAnalysisFeedbackEditorSettings(); }
public BatchUserSettings() { ProjectFiles = new List <string>(); DiagramOptions = new DiagramOptions(); ForceLayoutConfigutation = new ForceLayoutConfiguration(); ChartOptions = new ChartOptions(); DisplayUnits = new DisplayUnitsManager(); ComparerSettings = new ComparerSettings { CompareHiddenEntities = true }; JournalPageEditorSettings = new JournalPageEditorSettings(); ParameterIdentificationFeedbackEditorSettings = new ParameterIdentificationFeedbackEditorSettings(); MergeConflictViewSettings = new MergeConflictViewSettings(); }
public void Settings_IgnorePermissions_True() { Parallel.Invoke( () => Helpers.Database.ExecuteScript(m_Version, Helpers.Database.DatabaseLocation.Source, new[] { "create table test(c int);", "grant all on test to someuser;" }), () => Helpers.Database.ExecuteScript(m_Version, Helpers.Database.DatabaseLocation.Target, new[] { "create table test(c int);" })); var settings = new ComparerSettings(m_Version) { IgnorePermissions = true }; var compareResult = UpdateDatabase(settings); Assert.That(compareResult.AllStatements, Is.Empty); AssertComparerSeesNoDifference(settings); }
protected override void Context() { _presentationUserSettings = A.Fake <IPresentationUserSettings>(); _view = A.Fake <IMainComparisonView>(); _regionResolver = A.Fake <IRegionResolver>(); _comparisonPresenter = A.Fake <IComparisonPresenter>(); _comparerSettingsPresenter = A.Fake <IComparerSettingsPresenter>(); _dialogCreator = A.Fake <IDialogCreator>(); _exportToExcelTask = A.Fake <IExportDataTableToExcelTask>(); _userComparerSettings = A.Fake <ComparerSettings>(); _executionContext = A.Fake <IOSPSuiteExecutionContext>(); A.CallTo(() => _presentationUserSettings.ComparerSettings).Returns(_userComparerSettings); sut = new MainComparisonPresenterForSpecs(_view, _regionResolver, _comparisonPresenter, _comparerSettingsPresenter, _presentationUserSettings, _dialogCreator, _exportToExcelTask, _executionContext); }
public void TestSerializationComparerSettings() { var x1 = new ComparerSettings { FormulaComparison = FormulaComparison.Value, OnlyComputingRelevant = true, RelativeTolerance = 1e-2, ShowValueOrigin = false }; var x2 = SerializeAndDeserialize(x1); AssertForSpecs.AreEqualComparerSettings(x1, x2); }
protected override void Context() { _view = A.Fake <IComparisonView>(); _diffItemDTOMapper = A.Fake <IDiffItemToDiffItemDTOMapper>(); _objectComparer = A.Fake <IObjectComparer>(); _dataTableMapper = A.Fake <IDiffItemDTOsToDataTableMapper>(); sut = new ComparisonPresenter(_view, _objectComparer, _diffItemDTOMapper, _dataTableMapper); _settings = new ComparerSettings(); _object1 = A.Fake <IObjectBase>(); _object2 = A.Fake <IObjectBase>(); _report = new DiffReport(); A.CallTo(() => _objectComparer.Compare(_object1, _object2, _settings)).Returns(_report); }
public void Settings_IgnorePermissions_False() { Parallel.Invoke( () => Helpers.Database.ExecuteScript(m_Version, Helpers.Database.DatabaseLocation.Source, new[] { "create table test(c int);", "grant all on test to someuser;" }), () => Helpers.Database.ExecuteScript(m_Version, Helpers.Database.DatabaseLocation.Target, new[] { "create table test(c int);" })); var settings = new ComparerSettings(m_Version) { IgnorePermissions = false }; var compareResult = UpdateDatabase(settings); Assert.That(compareResult.AllStatements.Count(), Is.GreaterThanOrEqualTo(1)); Assert.That(compareResult.AllStatements.First(), Does.StartWith("GRANT ")); AssertComparerSeesNoDifference(settings); }
protected override void Context() { base.Context(); var f1 = new ExplicitFormula("5*6"); var f2 = new ExplicitFormula("5*6"); _object1 = new Parameter().WithFormula(f1); var parameter = new Parameter().WithFormula(f2); parameter.Value = 10; _object2 = parameter; _comparerSettings = new ComparerSettings { FormulaComparison = FormulaComparison.Formula }; }
protected override void Context() { base.Context(); var parameter1 = new Parameter().WithName("P1").WithValue(5); parameter1.ValueOrigin.Method = ValueOriginDeterminationMethods.Assumption; var parameter2 = new Parameter().WithName("P2").WithValue(6); parameter2.ValueOrigin.Method = ValueOriginDeterminationMethods.InVitro; _object1 = parameter1; _object2 = parameter2; _comparerSettings = new ComparerSettings { ShowValueOrigin = false }; }
protected override void Context() { base.Context(); var exp1 = new ExplicitFormula("5*P1"); var exp2 = new ExplicitFormula("5*P1"); exp1.AddObjectPath(new FormulaUsablePath(new string[] { ObjectPath.PARENT_CONTAINER, "P1" }).WithAlias("P1")); exp2.AddObjectPath(new FormulaUsablePath(new string[] { ObjectPath.PARENT_CONTAINER, "P1" }).WithAlias("P1")); _object1 = new Parameter { BuildMode = ParameterBuildMode.Local }.WithFormula(exp1); _object2 = new Parameter { BuildMode = ParameterBuildMode.Global }.WithFormula(exp2); _comparerSettings = new ComparerSettings { FormulaComparison = FormulaComparison.Value }; }
protected override void Context() { base.Context(); var c1 = new Container { Name = "O" }; var p11 = new Parameter { Name = "P1" }.WithParentContainer(c1); p11.Formula = new ConstantFormula(5); var p12 = new Parameter { Name = "P2" }.WithParentContainer(c1); p12.Formula = new ExplicitFormula("P1*5"); p12.Formula.AddObjectPath(new FormulaUsablePath(new[] { ObjectPath.PARENT_CONTAINER, p11.Name }).WithAlias(p11.Name)); var c2 = new Container { Name = "O" }; var p21 = new Parameter { Name = "P1" }.WithParentContainer(c2); p21.Formula = new ConstantFormula(10); var p22 = new Parameter { Name = "P2" }.WithParentContainer(c2); p22.Formula = new ExplicitFormula("P1*5"); p22.Formula.AddObjectPath(new FormulaUsablePath(new[] { ObjectPath.PARENT_CONTAINER, p21.Name }).WithAlias(p21.Name)); _object1 = c1; _object2 = c2; _comparerSettings = new ComparerSettings { FormulaComparison = FormulaComparison.Value }; }
protected MainComparisonPresenter(IMainComparisonView view, IRegionResolver regionResolver, IComparisonPresenter comparisonPresenter, IComparerSettingsPresenter comparerSettingsPresenter, IPresentationUserSettings presentationUserSettings, IDialogCreator dialogCreator, IExportDataTableToExcelTask exportToExcelTask, IOSPSuiteExecutionContext executionContext, RegionName regionName) : base(view) { _regionResolver = regionResolver; _comparisonPresenter = comparisonPresenter; _comparerSettingsPresenter = comparerSettingsPresenter; _dialogCreator = dialogCreator; _exportToExcelTask = exportToExcelTask; _executionContext = executionContext; _regionName = regionName; AddSubPresenters(_comparisonPresenter, comparerSettingsPresenter); view.AddSettingsView(comparerSettingsPresenter.View); view.AddComparisonView(_comparisonPresenter.View); view.SettingsVisible = false; _comparerSettings = presentationUserSettings.ComparerSettings; comparerSettingsPresenter.Edit(_comparerSettings); updateButtons(); }
public void Compare(string name) { var testCaseStructure = (TestCaseStructure)Activator.CreateInstance(Type.GetType(name)); if (!testCaseStructure.IsCompatibleWithVersion(m_Version)) { Assert.Inconclusive($"Test is not compatible with {m_Version}."); return; } Parallel.Invoke( () => Helpers.Database.ExecuteScript(m_Version, Helpers.Database.DatabaseLocation.Source, testCaseStructure.Source), () => Helpers.Database.ExecuteScript(m_Version, Helpers.Database.DatabaseLocation.Target, testCaseStructure.Target)); var settings = new ComparerSettings(m_Version); var compareResult = CompareAndUpdateDatabase(settings, testCaseStructure); if (compareResult != null) { AssertNoDifferenceBetweenSourceAndTarget(); AssertComparerSeesNoDifference(settings); ExecuteSpecificAsserts(testCaseStructure, compareResult); } }
public UserSettings(DockManager dockManager, RibbonBarManager ribbonManager, INumericFormatterOptions numericFormatterOptions, ISkinManager skinManager, IPKSimConfiguration configuration, DirectoryMapSettings directoryMapSettings) { _dockManager = dockManager; _ribbonManager = ribbonManager; _numericFormatterOptions = numericFormatterOptions; _skinManager = skinManager; _directoryMapSettings = directoryMapSettings; DisplayUnits = new DisplayUnitsManager(); ComparerSettings = new ComparerSettings { CompareHiddenEntities = false }; ProjectFiles = new List <string>(); Rules.AddRange(AllRules.All()); DiagramOptions = new DiagramOptions(); TemplateDatabasePath = configuration.DefaultTemplateUserDatabasePath; JournalPageEditorSettings = new JournalPageEditorSettings(); ParameterIdentificationFeedbackEditorSettings = new ParameterIdentificationFeedbackEditorSettings(); SensitivityAnalysisFeedbackEditorSettings = new SensitivityAnalysisFeedbackEditorSettings(); ResetToDefault(); _layoutWasExplicitelyReset = false; }
protected override void Context() { sut = IoC.Resolve <IObjectComparer>(); _comparerSettings = new ComparerSettings(); }
protected override void Context() { _view = A.Fake <IComparerSettingsView>(); _comparerSettings = new ComparerSettings(); sut = new ComparerSettingsPresenter(_view); }
public void BindTo(ComparerSettings comparerSettings) { _screenBinder.BindToSource(comparerSettings); }
public static Span CreateSpanObject(List <ComparisonUnit> comparisonUnits, bool includeTagsInComparison, ComparerSettings comparerSettings) { var span = new Span(); span.Inlines.Clear(); foreach (var tccu in comparisonUnits) { if (tccu.Type == ComparisonUnit.ComparisonType.Identical) { foreach (var trgu in tccu.Section) { if (trgu.CntType == ContentSection.ContentType.Text) { span.Inlines.Add(new Run(tccu.Text)); } else if (includeTagsInComparison) { var run = new Run(tccu.Text) { Foreground = Brushes.Gray }; span.Inlines.Add(run); } } } else { foreach (var trgu in tccu.Section) { if (trgu.CntType == ContentSection.ContentType.Text) { if (tccu.Type == ComparisonUnit.ComparisonType.New) { var run = new Run(tccu.Text); run = GetRunFormatting(run, comparerSettings.StyleNewText); span.Inlines.Add(run); } else { var run = new Run(tccu.Text); run = GetRunFormatting(run, comparerSettings.StyleRemovedText); span.Inlines.Add(run); } } else if (includeTagsInComparison) { if (tccu.Type == ComparisonUnit.ComparisonType.New) { var run = new Run(tccu.Text); run = GetRunFormatting(run, comparerSettings.StyleNewTag); span.Inlines.Add(run); } else { var run = new Run(tccu.Text); run = GetRunFormatting(run, comparerSettings.StyleRemovedTag); span.Inlines.Add(run); } } } } } return(span); }
public void Edit(ComparerSettings comparerSettings) { _view.BindTo(comparerSettings); }
public void StartComparison(IObjectBase leftObject, IObjectBase rightObject, string leftCaption, string rightCaption, ComparerSettings comparerSettings) { var diffReport = _objectComparer.Compare(leftObject, rightObject, comparerSettings); _view.LeftCaption = leftCaption; _view.RightCaption = rightCaption; _allDiffItemDTO = diffReport.Select(mapFrom).ToList(); _view.BindTo(_allDiffItemDTO); EnumHelper.AllValuesFor <PathElement>().Each(updateColumnVisibility); //Always hide name _view.SetVisibility(PathElement.Name, visible: false); _view.DifferenceTableVisible = _allDiffItemDTO.Any(); }