Skip to content

Commit 047c52a

Browse files
author
PREMIER\Njabulo.Nxele
committed
Merge branch 'develop' into 7257-AdvancedRecordsetFuncitonsNotWorking
2 parents 3d57c54 + 47b8a3b commit 047c52a

File tree

7 files changed

+58
-8
lines changed

7 files changed

+58
-8
lines changed

Dev/Dev2.Activities.Designers.Tests/Decision/DecisionTests.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ public void DecisionDesignerViewModel_Validate_All()
388388
TrueArmText = "",
389389
FalseArmText = ""
390390
};
391+
viewModel.Collection.RemoveAt(0);
391392
//------------Execute Test---------------------------
392393
viewModel.Validate();
393394
//------------Assert Results-------------------------
@@ -410,6 +411,7 @@ public void DecisionDesignerViewModel_Validate_DisplayText()
410411
TrueArmText = "some text",
411412
FalseArmText = "some text"
412413
};
414+
viewModel.Collection.RemoveAt(0);
413415
//------------Execute Test---------------------------
414416
viewModel.Validate();
415417
//------------Assert Results-------------------------
@@ -433,6 +435,7 @@ public void DecisionDesignerViewModel_Validate_TrueArm()
433435
TrueArmText = "",
434436
FalseArmText = "some text"
435437
};
438+
viewModel.Collection.RemoveAt(0);
436439
//------------Execute Test---------------------------
437440
viewModel.Validate();
438441
//------------Assert Results-------------------------
@@ -456,6 +459,7 @@ public void DecisionDesignerViewModel_Validate_FalseText()
456459
TrueArmText = "some text",
457460
FalseArmText = ""
458461
};
462+
viewModel.Collection.RemoveAt(0);
459463
//------------Execute Test---------------------------
460464
viewModel.Validate();
461465
//------------Assert Results-------------------------
@@ -466,6 +470,25 @@ public void DecisionDesignerViewModel_Validate_FalseText()
466470
Assert.IsTrue(viewModel.IsFalseArmFocused);
467471
}
468472

473+
[TestMethod]
474+
[Owner("Ashley Lewis")]
475+
[TestCategory(nameof(DecisionDesignerViewModel))]
476+
public void DecisionDesignerViewModel_Validate_MatchType()
477+
{
478+
//------------Setup for test--------------------------
479+
var viewModel = new DecisionDesignerViewModel(CreateModelItem())
480+
{
481+
DisplayText = "text",
482+
TrueArmText = "some text",
483+
FalseArmText = "some text"
484+
};
485+
//------------Execute Test---------------------------
486+
viewModel.Validate();
487+
//------------Assert Results-------------------------
488+
Assert.IsNotNull(viewModel.Errors);
489+
Assert.AreEqual(1, viewModel.Errors.Count);
490+
Assert.AreEqual(Warewolf.Resource.Errors.ErrorResource.DecisionMatchTypeNotNullErrorTest, viewModel.Errors[0].Message);
491+
}
469492

470493
[TestMethod]
471494
[Owner("Hagashen Naidu")]

Dev/Dev2.Activities.Designers/Designers2/Decision/DecisionDesignerViewModel.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,22 +305,28 @@ protected override IEnumerable<IActionableErrorInfo> ValidateThis()
305305
yield return error;
306306
}
307307

308-
foreach (var error in GetRuleSet("TrueArmText").ValidateRules("'TrueArmText'", () => IsTrueArmFocused = true))
309-
308+
foreach (var error in GetRuleSet("TrueArmText").ValidateRules("'TrueArmText'", () => IsTrueArmFocused = true))
310309
{
311310
yield return error;
312311
}
313312

314-
foreach (var error in GetRuleSet("FalseArmText").ValidateRules("'FalseArmText'", () => IsFalseArmFocused = true))
315-
313+
foreach (var error in GetRuleSet("FalseArmText").ValidateRules("'FalseArmText'", () => IsFalseArmFocused = true))
316314
{
317315
yield return error;
318316
}
319317
}
320318

321319
protected override IEnumerable<IActionableErrorInfo> ValidateCollectionItem(IDev2TOFn mi)
322-
{
323-
yield break;
320+
{
321+
if (!(mi as DecisionTO).IsLast)
322+
{
323+
var ruleSet = new RuleSet();
324+
ruleSet.Add(new IsStringEmptyOrWhiteSpaceRule(() => ((mi as DecisionTO).SearchType)));
325+
foreach (var error in ruleSet.ValidateRules("'MatchType'", null))
326+
{
327+
yield return error;
328+
}
329+
}
324330
}
325331

326332
IRuleSet GetRuleSet(string propertyName)

Dev/Dev2.Studio.Core/DataList/DataListViewModel.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,10 @@ public List<IDataListVerifyPart> UpdateDataListItems(IResourceModel contextualRe
10851085
{
10861086
IList<IDataListVerifyPart> removeParts = MissingWorkflowItems(workflowFields);
10871087
var filteredDataListParts = MissingDataListParts(workflowFields);
1088+
if (filteredDataListParts.Count > 0)
1089+
{
1090+
Dev2Logger.Debug("Found " + filteredDataListParts.Count + " missing datalist variables. First variable name: " + filteredDataListParts.FirstOrDefault().DisplayValue + ".", GlobalConstants.WarewolfDebug);
1091+
}
10881092
ShowUnusedDataListVariables(contextualResourceModel, removeParts, workflowFields);
10891093
ViewModelUtils.RaiseCanExecuteChanged(DeleteCommand);
10901094
if(contextualResourceModel != Resource)

Dev/Dev2.Studio.Core/DataList/ScalarHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public void AddScalars(XmlNode xmlNode)
8080
private void UpdateScalar(IScalarItemModel scalar)
8181
{
8282
scalar.IsVisible = _vm.IsItemVisible(scalar.Name);
83+
Dev2Logger.Debug("Adding item to the Datalist scalar observable collection: " + scalar.DisplayName, GlobalConstants.WarewolfDebug);
8384
if (_vm.ScalarCollectionCount > 0)
8485
{
8586
_vm.ScalarCollection.Insert(_vm.ScalarCollectionCount - 1, scalar);

Dev/Warewolf.Resource/Errors/ErrorResource.Designer.cs

Lines changed: 13 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dev/Warewolf.Resource/Errors/ErrorResource.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,4 +1409,7 @@ Please contact your Windows System Administrator.</value>
14091409
<data name="ErrorDuringDuplicateFolderCallback" xml:space="preserve">
14101410
<value>The following error occurred while executing the duplicate folder callback '{0}'.</value>
14111411
</data>
1412+
<data name="DecisionMatchTypeNotNullErrorTest" xml:space="preserve">
1413+
<value>'MatchType' Cannot be null</value>
1414+
</data>
14121415
</root>

Dev/Warewolf.Studio.Views/ActivityDefaultWindow.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Dev2.Activities.Designers2.Core;
88
using Dev2.Activities.Designers2.Decision;
99
using Dev2.Activities.Designers2.Switch;
10+
using Dev2.Common;
1011
using Dev2.Common.Interfaces.Studio.Controller;
1112
using Dev2.Studio.Interfaces;
1213
using Warewolf.Studio.Core;
@@ -62,6 +63,7 @@ void DoneButton_OnClick(object sender, RoutedEventArgs e)
6263
if (valid)
6364
{
6465
DialogResult = true;
66+
Dev2Logger.Debug("Closing Decision dialog.", GlobalConstants.WarewolfDebug);
6567
Close();
6668
}
6769
}

0 commit comments

Comments
 (0)