-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/dev' into main
- Loading branch information
Showing
70 changed files
with
2,164 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5.10.1 | ||
5.11.0 |
25 changes: 25 additions & 0 deletions
25
src/Moryx.AbstractionLayer.TestTools/DummyProductPartLink.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) 2020, Phoenix Contact GmbH & Co. KG | ||
// Licensed under the Apache License, Version 2.0 | ||
|
||
using Moryx.AbstractionLayer.Products; | ||
using System.Linq; | ||
|
||
namespace Moryx.AbstractionLayer.TestTools | ||
{ | ||
/// <summary> | ||
/// Dummy implementation of a ProductPartLink. | ||
/// </summary> | ||
public class DummyProductPartLink : ProductPartLink<DummyProductType> | ||
{ | ||
public override bool Equals(object obj) | ||
{ | ||
var toCompareWith = obj as DummyProductPartLink; | ||
if (toCompareWith == null) | ||
return false; | ||
|
||
return GetType().GetProperties() | ||
.All(prop => (prop.GetValue(toCompareWith) is null && prop.GetValue(this) is null) | ||
|| prop.GetValue(toCompareWith).Equals(prop.GetValue(this))); | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
src/Moryx.AbstractionLayer.TestTools/DummyProductRecipe.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) 2020, Phoenix Contact GmbH & Co. KG | ||
// Licensed under the Apache License, Version 2.0 | ||
|
||
using Moryx.AbstractionLayer.Recipes; | ||
using Moryx.Workflows; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Moryx.AbstractionLayer.TestTools | ||
{ | ||
/// <summary> | ||
/// Dummy implementation of an product instance. Created by the <see cref="DummyProductType"/> | ||
/// </summary> | ||
public class DummyProductRecipe : ProductRecipe | ||
{ | ||
public override bool Equals(object obj) | ||
{ | ||
var toCompareWith = obj as DummyProductRecipe; | ||
if (toCompareWith == null) | ||
return false; | ||
|
||
return toCompareWith.Name == Name && toCompareWith.Revision == Revision | ||
&& toCompareWith.State == State && toCompareWith.Classification == Classification | ||
&& ((toCompareWith.Origin is null && Origin is null) || Origin.Equals(toCompareWith.Origin)) | ||
&& ((toCompareWith.Product is null && Product is null) || Product.Equals(toCompareWith.Product)) | ||
&& ((toCompareWith.Target is null && Target is null) || Target.Equals(toCompareWith.Target)); | ||
} | ||
} | ||
|
||
public class DummyProductWorkplanRecipe : DummyProductRecipe, IWorkplanRecipe | ||
{ | ||
public IWorkplan Workplan { get; set; } | ||
|
||
public ICollection<long> DisabledSteps { get; set; } | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
var toCompareWith = obj as DummyProductWorkplanRecipe; | ||
if (toCompareWith == null) | ||
return false; | ||
|
||
return base.Equals(toCompareWith) | ||
&& ((toCompareWith.Workplan is null && Workplan is null) || Workplan.Equals(toCompareWith.Workplan)) | ||
&& ((toCompareWith.DisabledSteps is null && DisabledSteps is null) || Enumerable.SequenceEqual<long>(DisabledSteps, toCompareWith.DisabledSteps)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) 2020, Phoenix Contact GmbH & Co. KG | ||
// Licensed under the Apache License, Version 2.0 | ||
|
||
using Moryx.Workflows; | ||
using System.Linq; | ||
|
||
namespace Moryx.AbstractionLayer.TestTools | ||
{ | ||
public class DummyWorkplan : Workplan | ||
{ | ||
public override bool Equals(object obj) | ||
{ | ||
var toCompareWith = obj as DummyWorkplan; | ||
if (toCompareWith == null) | ||
return false; | ||
|
||
return toCompareWith.Id == Id && toCompareWith.Name == Name | ||
&& toCompareWith.Version == toCompareWith.Version && toCompareWith.State == State | ||
&& ((toCompareWith.Connectors is null && Connectors is null) || Enumerable.SequenceEqual(toCompareWith.Connectors, Connectors)) | ||
&& ((toCompareWith.Steps is null && Steps is null) || Enumerable.SequenceEqual(toCompareWith.Steps, Steps)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/Moryx.AbstractionLayer/Products/ProductFacadeExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) 2021, Phoenix Contact GmbH & Co. KG | ||
// Licensed under the Apache License, Version 2.0 | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq.Expressions; | ||
|
||
namespace Moryx.AbstractionLayer.Products | ||
{ | ||
/// <summary> | ||
/// Extensions for the <see cref="IProductManagement"/> facade | ||
/// </summary> | ||
public static class ProductFacadeExtensions | ||
{ | ||
/// <summary> | ||
/// Bridge extension for LoadTypes using filter expression | ||
/// </summary> | ||
public static IReadOnlyList<TType> LoadTypes<TType>(this IProductManagement facade, Expression<Func<TType, bool>> selector) | ||
{ | ||
if (facade is IProductManagementTypeSearch typeSearch) | ||
return typeSearch.LoadTypes(selector); | ||
|
||
throw new NotSupportedException("Instance of product management does not support expression type search"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.