Skip to content

Commit

Permalink
Added document code C085 (#46)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Anderson <[email protected]>
  • Loading branch information
t11omas and Thomas Anderson authored Jan 7, 2025
1 parent 598546b commit 2e7f4f1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
34 changes: 34 additions & 0 deletions Btms.Business.Tests/ImportNotificationTypeEnumExtensionsTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Btms.Business.Extensions;
using Btms.Model;
using Btms.Model.Ipaffs;
using FluentAssertions;
using Xunit;

namespace Btms.Business.Tests;

public class ImportNotificationTypeEnumExtensionsTests
{
[Theory]
[InlineData("9115", ImportNotificationTypeEnum.Chedpp)]
[InlineData("C633", ImportNotificationTypeEnum.Chedpp)]
[InlineData("N002", ImportNotificationTypeEnum.Chedpp)]
[InlineData("N851", ImportNotificationTypeEnum.Chedpp)]
[InlineData("C085", ImportNotificationTypeEnum.Chedpp)]

[InlineData("N852", ImportNotificationTypeEnum.Ced)]
[InlineData("C678", ImportNotificationTypeEnum.Ced)]

[InlineData("C640", ImportNotificationTypeEnum.Cveda)]

[InlineData("C641", ImportNotificationTypeEnum.Cvedp)]
[InlineData("C673", ImportNotificationTypeEnum.Cvedp)]
[InlineData("N853", ImportNotificationTypeEnum.Cvedp)]

[InlineData("9HCG", null)]
public void DocumentCode_ToChedType(string documentCode, ImportNotificationTypeEnum? expected)
{
var result = documentCode.GetChedType();

result.Should().Be(expected);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ public static class ImportNotificationTypeEnumExtensions
public static ImportNotificationTypeEnum? GetChedType(this string documentCode)
{
//This is the mapping from https://eaflood.atlassian.net/wiki/spaces/ALVS/pages/5177016349/DocumentCode+Field
// "C085" isn't on the wiki page, but after a discussion with Matt, it appears it maps to ChedPP
return documentCode switch
{
"9115"or "C633" or "N002" or "N851" => ImportNotificationTypeEnum.Chedpp,
"9115"or "C633" or "N002" or "N851" or "C085" => ImportNotificationTypeEnum.Chedpp,
"N852" or "C678" => ImportNotificationTypeEnum.Ced,
"C640" => ImportNotificationTypeEnum.Cveda,
"C641" or "C673" or "N853" => ImportNotificationTypeEnum.Cvedp,
Expand Down

0 comments on commit 2e7f4f1

Please sign in to comment.