forked from microsoft/OpenAPI.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChangedEnumBO.cs
25 lines (22 loc) · 857 Bytes
/
ChangedEnumBO.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System.Collections.Generic;
using Microsoft.OpenApi.Diff.Enums;
using Microsoft.OpenApi.Diff.Extensions;
namespace Microsoft.OpenApi.Diff.BusinessObjects
{
public class ChangedEnumBO : ChangedListBO<string>
{
protected override ChangedElementTypeEnum GetElementType() => ChangedElementTypeEnum.Enum;
public ChangedEnumBO(IList<string> oldValue, IList<string> newValue, DiffContextBO context) : base(oldValue, newValue, context)
{
}
public override DiffResultBO IsItemsChanged()
{
if (Context.IsRequest && Missing.IsNullOrEmpty()
|| Context.IsResponse && Increased.IsNullOrEmpty())
{
return new DiffResultBO(DiffResultEnum.Compatible);
}
return new DiffResultBO(DiffResultEnum.Incompatible);
}
}
}